This commit is contained in:
Andreas Rumpf 2020-06-07 23:29:26 +02:00 • committed by GitHub
commit 754a196d47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -390,7 +390,6 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =
let bbody = lastSon body let bbody = lastSon body
var newbody = replaceTypeVarsT(cl, bbody) var newbody = replaceTypeVarsT(cl, bbody)
let bodyIsNew = newbody != bbody
cl.skipTypedesc = oldSkipTypedesc cl.skipTypedesc = oldSkipTypedesc
newbody.flags = newbody.flags + (t.flags + body.flags - tfInstClearedFlags) newbody.flags = newbody.flags + (t.flags + body.flags - tfInstClearedFlags)
result.flags = result.flags + newbody.flags - tfInstClearedFlags result.flags = result.flags + newbody.flags - tfInstClearedFlags
@ -412,7 +411,7 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =
# generics *when the type is constructed*: # generics *when the type is constructed*:
newbody.attachedOps[attachedDeepCopy] = cl.c.instTypeBoundOp(cl.c, dc, result, cl.info, newbody.attachedOps[attachedDeepCopy] = cl.c.instTypeBoundOp(cl.c, dc, result, cl.info,
attachedDeepCopy, 1) attachedDeepCopy, 1)
if bodyIsNew and newbody.typeInst == nil: if newbody.typeInst == nil:
#doassert newbody.typeInst == nil #doassert newbody.typeInst == nil
newbody.typeInst = result newbody.typeInst = result
if tfRefsAnonObj in newbody.flags and newbody.kind != tyGenericInst: if tfRefsAnonObj in newbody.flags and newbody.kind != tyGenericInst: