summary refs log tree commit diff stats
diff options
context:
space:
mode:
authordef <dennis@felsin9.de>2015-03-13 02:17:46 +0100
committerdef <dennis@felsin9.de>2015-03-13 02:17:46 +0100
commitc19d6cb6201d86b7fb3cabe33134b1d555881de4 (patch)
tree05a9436be075ce59ed47514a193dd6cb1c359ae7
parentd6c957e9b438ceb340c14139c9141ca102de4fa5 (diff)
downloadNim-c19d6cb6201d86b7fb3cabe33134b1d555881de4.tar.gz
Fix infinite recursion in semtypes with recursive types
Fixes #2213
-rw-r--r--compiler/semtypes.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index ac0636211..5e9e584eb 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -787,6 +787,8 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode,
       result = addImplicitGeneric(typ)
     else:
       for i in 0 .. <paramType.sons.len:
+        if paramType.sons[i] == paramType:
+          localError(info, errIllegalRecursionInTypeX, typeToString(paramType))
         var lifted = liftingWalk(paramType.sons[i])
         if lifted != nil:
           paramType.sons[i] = lifted