diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-01-04 15:59:10 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-01-04 15:59:10 +0100 |
commit | 464d037c1758243664d46595ab4bd800d86e041f (patch) | |
tree | 2885cc822fa362f6f5b8603b882feab6e0a02a18 /compiler/semexprs.nim | |
parent | 2e635ab28cb60be5e63e01ecf074596ccc385696 (diff) | |
parent | 2cf94fe7e74afcd48aa8ee19f59231baf56737d6 (diff) | |
download | Nim-464d037c1758243664d46595ab4bd800d86e041f.tar.gz |
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index a0f519820..51e75e91f 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1425,11 +1425,7 @@ proc semProcBody(c: PContext, n: PNode): PNode = openScope(c) result = semExpr(c, n) if c.p.resultSym != nil and not isEmptyType(result.typ): - # transform ``expr`` to ``result = expr``, but not if the expr is already - # ``result``: - if result.kind == nkSym and result.sym == c.p.resultSym: - discard - elif result.kind == nkNilLit: + if result.kind == nkNilLit: # or ImplicitlyDiscardable(result): # new semantic: 'result = x' triggers the void context result.typ = nil |