summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-05-28 17:14:35 +0300
committerZahary Karadjov <zahary@gmail.com>2013-08-19 01:36:04 +0300
commit8b933e470e46c5f314d81529626c15dab4de228f (patch)
treec0bb9213d67f85a0a59c9d6358600f0f114d273b
parentc6d06111122f4519bc5a03319aa0ff89a6a60184 (diff)
downloadNim-8b933e470e46c5f314d81529626c15dab4de228f.tar.gz
fixes iterating over enums
-rw-r--r--compiler/semtypes.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 2c6fc4738..703b55ace 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -236,11 +236,11 @@ proc semTypeIdent(c: PContext, n: PNode): PSym =
       markUsed(n, result)
       if result.kind == skParam and result.typ.kind == tyTypeDesc:
         # This is a typedesc param. is it already bound?
-        # it's not bound when it's also used as return type for example
-        if result.typ.sonsLen > 0:
+        # it's not bound when it's used multiple times in the
+        # proc signature for example
+        if c.InGenericInst > 0:
           let bound = result.typ.sons[0].sym
-          if bound != nil:
-            return bound
+          if bound != nil: return bound
           return result
         if result.typ.sym == nil:
           LocalError(n.info, errTypeExpected)