summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-04-28 10:11:41 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-04-28 10:11:41 +0200
commita432aedb5457f113d2389bfd09fbb20fd6eafc9b (patch)
tree0092043e8763a304188480ab95f926ea04ecf4cc /compiler
parentda3b649539c856fb9126d28f4354bf0170b363ad (diff)
downloadNim-a432aedb5457f113d2389bfd09fbb20fd6eafc9b.tar.gz
Generic tuple recursion fix (#11115)
* fixes #1145
* unify error messages
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypes.nim4
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)
#n125'>125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184