diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 0bb27946f1..04d2577075 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -189,14 +189,32 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType = newbody.flags = newbody.flags + t.flags + body.flags result.flags = result.flags + newbody.flags newbody.callConv = body.callConv - newbody.n = replaceTypeVarsN(cl, lastSon(body).n) # This type may be a generic alias and we want to resolve it here. # One step is enough, because the recursive nature of # handleGenericInvokation will handle the alias-to-alias-to-alias case if newbody.isGenericAlias: newbody = newbody.skipGenericAlias rawAddSon(result, newbody) checkPartialConstructedType(cl.info, newbody) + +proc normalizeProcType(t: PType) = + if t.sons[0] != nil and t.sons[0].kind == tyEmpty: + t.sons[0] = nil + for i in 1 ..