diff options
author | def <dennis@felsin9.de> | 2015-03-13 02:17:46 +0100 |
---|---|---|
committer | def <dennis@felsin9.de> | 2015-03-13 02:17:46 +0100 |
commit | c19d6cb6201d86b7fb3cabe33134b1d555881de4 (patch) | |
tree | 05a9436be075ce59ed47514a193dd6cb1c359ae7 | |
parent | d6c957e9b438ceb340c14139c9141ca102de4fa5 (diff) | |
download | Nim-c19d6cb6201d86b7fb3cabe33134b1d555881de4.tar.gz |
Fix infinite recursion in semtypes with recursive types
Fixes #2213
-rw-r--r-- | compiler/semtypes.nim | 2 |
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 |