globalError instead of localError when failing infinite recursion

globalError throws an exception, so this works for `nim check` as well.
This commit is contained in:
def
2015-03-13 17:17:42 +01:00
parent c19d6cb620
commit d77c883911

View File

@@ -788,7 +788,7 @@ proc liftParamType(c: PContext, procKind: TSymKind, genericParams: PNode,
else:
for i in 0 .. <paramType.sons.len:
if paramType.sons[i] == paramType:
localError(info, errIllegalRecursionInTypeX, typeToString(paramType))
globalError(info, errIllegalRecursionInTypeX, typeToString(paramType))
var lifted = liftingWalk(paramType.sons[i])
if lifted != nil:
paramType.sons[i] = lifted