Skip to content

Commit

Permalink
fixes #14315 (#14594)
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored Jun 7, 2020
1 parent 419dbd5 commit 754a196
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/semtypinst.nim
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =

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

0 comments on commit 754a196

Please sign in to comment.