summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2016-09-30 08:37:09 +0200
committerJohannes Hofmann <johannes.hofmann@gmx.de>2016-09-30 08:37:09 +0200
commit72ee6f78c5ae1d2eff406d3b39fd6820887e22ad (patch)
tree88a38cc7d0d7bd022006d1edc73820f6d41f755e /compiler/semstmts.nim
parent1dccbaf9a0cc0256701cfbae5bbb17b4d4e9416a (diff)
parentc035fd93f465ec2bc47645b4b838bec946ee88f0 (diff)
downloadNim-72ee6f78c5ae1d2eff406d3b39fd6820887e22ad.tar.gz
Merge branch 'devel' into unify_waitpid_handling
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 97c3b6ddd..ebcff643f 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -155,7 +155,10 @@ proc discardCheck(c: PContext, result: PNode) =
       else:
         var n = result
         while n.kind in skipForDiscardable: n = n.lastSon
-        localError(n.info, errDiscardValueX, result.typ.typeToString)
+        if result.typ.kind == tyProc:
+          localError(n.info, "value of type '" & result.typ.typeToString & "' has to be discarded; for a function call use ()")
+        else:
+          localError(n.info, errDiscardValueX, result.typ.typeToString)
 
 proc semIf(c: PContext, n: PNode): PNode =
   result = n