diff options
author | Johannes Hofmann <johannes.hofmann@gmx.de> | 2016-09-30 08:37:09 +0200 |
---|---|---|
committer | Johannes Hofmann <johannes.hofmann@gmx.de> | 2016-09-30 08:37:09 +0200 |
commit | 72ee6f78c5ae1d2eff406d3b39fd6820887e22ad (patch) | |
tree | 88a38cc7d0d7bd022006d1edc73820f6d41f755e /compiler/semstmts.nim | |
parent | 1dccbaf9a0cc0256701cfbae5bbb17b4d4e9416a (diff) | |
parent | c035fd93f465ec2bc47645b4b838bec946ee88f0 (diff) | |
download | Nim-72ee6f78c5ae1d2eff406d3b39fd6820887e22ad.tar.gz |
Merge branch 'devel' into unify_waitpid_handling
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r-- | compiler/semstmts.nim | 5 |
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 |