fixes #12336 [backport]

This commit is contained in:
Andreas Rumpf 2019-10-02 17:01:27 +02:00
commit 98e76a1058

View file

@ -589,7 +589,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType =
for i in 0 ..< len(result): for i in 0 ..< len(result):
if result.sons[i] != nil: if result.sons[i] != nil:
if result.sons[i].kind == tyGenericBody: if result.sons[i].kind == tyGenericBody:
localError(cl.c.config, t.sym.info, localError(cl.c.config, if t.sym != nil: t.sym.info else: cl.info,
"cannot instantiate '" & "cannot instantiate '" &
typeToString(result.sons[i], preferDesc) & typeToString(result.sons[i], preferDesc) &
"' inside of type definition: '" & "' inside of type definition: '" &