Merge pull request #2333 from def-/recursive-type
Fix infinite recursion in semtypes with recursive types
This commit is contained in:
commit
faad6ed67f
2 changed files with 10 additions and 0 deletions
|
|
@ -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:
|
||||
globalError(info, errIllegalRecursionInTypeX, typeToString(paramType))
|
||||
var lifted = liftingWalk(paramType.sons[i])
|
||||
if lifted != nil:
|
||||
paramType.sons[i] = lifted
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue