Generic tuple recursion fix (#11115)
* fixes #1145 * unify error messages
This commit is contained in:
parent
da3b649539
commit
a432aedb54
4 changed files with 13 additions and 4 deletions
|
|
@ -1348,8 +1348,8 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType =
|
|||
# special check for generic object with
|
||||
# generic/partial specialized parent
|
||||
let tx = result.skipTypes(abstractPtrs, 50)
|
||||
if tx.isNil:
|
||||
localError(c.config, n.info, "invalid recursion in type '$1'" % typeToString(result[0]))
|
||||
if tx.isNil or isTupleRecursive(tx):
|
||||
localError(c.config, n.info, "illegal recursion in type '$1'" % typeToString(result[0]))
|
||||
return errorType(c)
|
||||
if tx != result and tx.kind == tyObject and tx.sons[0] != nil:
|
||||
semObjectTypeForInheritedGenericInst(c, n, tx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue