summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2016-07-31 02:13:32 +0300
committerZahary Karadjov <zahary@gmail.com>2017-03-24 16:58:15 +0200
commit0a9a878bd34c9e38eeee36180ce171f54423b45c (patch)
tree53c22dbd42af23fa464ff31fd00dcbaf37fba0ee /compiler/semstmts.nim
parent33f4e69759820021f6b5089fe3798233b2a1fb13 (diff)
downloadNim-0a9a878bd34c9e38eeee36180ce171f54423b45c.tar.gz
support for matching generic types' procs in generic concepts
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 9a1850932..33b684e91 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1631,8 +1631,12 @@ 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 and result.sons[0].kind != nkDefer:
+  
+  if result.len == 1 and
+     c.inTypeClass == 0 and # concept bodies should be preserved as a stmt list
+     result.sons[0].kind != nkDefer:
     result = result.sons[0]
+
   when defined(nimfix):
     if result.kind == nkCommentStmt and not result.comment.isNil and
         not (result.comment[0] == '#' and result.comment[1] == '#'):