summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
authorYuriy Glukhov <yuriy.glukhov@gmail.com>2015-08-07 17:22:28 +0300
committerYuriy Glukhov <yuriy.glukhov@gmail.com>2015-08-07 17:22:28 +0300
commit7bc3d7da75c0d3b504c90842016e887407e6ed40 (patch)
tree467a7be535dd17a92b4f920206acbe653fd6f98a /compiler/semstmts.nim
parentb2516258407216a9f6fbf3c6b3e9cf72e12e44d3 (diff)
downloadNim-7bc3d7da75c0d3b504c90842016e887407e6ed40.tar.gz
Fixes #3186
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index b9b175962..3d9363d77 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1440,7 +1440,7 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
           of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: discard
           else: localError(n.sons[j].info, errStmtInvalidAfterReturn)
       else: discard
-  if result.len == 1:
+  if result.len == 1 and result.sons[0].kind != nkDefer:
     result = result.sons[0]
   when defined(nimfix):
     if result.kind == nkCommentStmt and not result.comment.isNil and