diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-04-28 10:11:41 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-04-28 10:11:41 +0200 |
commit | a432aedb5457f113d2389bfd09fbb20fd6eafc9b (patch) | |
tree | 0092043e8763a304188480ab95f926ea04ecf4cc /compiler | |
parent | da3b649539c856fb9126d28f4354bf0170b363ad (diff) | |
download | Nim-a432aedb5457f113d2389bfd09fbb20fd6eafc9b.tar.gz |
Generic tuple recursion fix (#11115)
* fixes #1145 * unify error messages
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semtypes.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index e24597956..d0c8c8520 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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) |