summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r--compiler/semexprs.nim6
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
title='author Andreas Rumpf <rumpf_a@web.de> 2010-02-24 01:04:39 +0100 committer Andreas Rumpf <rumpf_a@web.de> 2010-02-24 01:04:39 +0100 SQLite wrapper' href='/ahoang/Nim/commit/contributors.txt?h=devel&id=f41bd71e6152174c3b0819c7549fa431e8a01222'>f41bd71e6 ^
564c9f401 ^
5eea125ba ^
f41bd71e6 ^
eab773f06 ^
1
2
3
4
5
6
7
8
9
10
11
12