summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-08-26 14:04:56 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-08-26 14:04:56 +0200
commit1d1253c87f2cba4e498db48d16cbe88fb0d8850b (patch)
treee5a9f1df620e865ab9a11e1b222254717d1e42da
parent4d4a993e7f47354b3de80c3f307a7a8d2b50e99b (diff)
downloadNim-1d1253c87f2cba4e498db48d16cbe88fb0d8850b.tar.gz
fixes #4253
-rw-r--r--compiler/types.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/types.nim b/compiler/types.nim
index c06e906e5..4690d5a1f 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -1057,10 +1057,10 @@ proc typeAllowedNode(marker: var IntSet, n: PNode, kind: TSymKind,
       of nkNone..nkNilLit:
         discard
       else:
+        if n.kind == nkRecCase and kind in {skProc, skConst}:
+          return n[0].typ
         for i in countup(0, sonsLen(n) - 1):
           let it = n.sons[i]
-          if it.kind == nkRecCase and kind in {skProc, skConst}:
-            return n.typ
           result = typeAllowedNode(marker, it, kind, flags)
           if result != nil: break