fixes #12092
This commit is contained in:
parent
9ae0dd611f
commit
a055f628f4
2 changed files with 16 additions and 2 deletions
|
|
@ -1595,7 +1595,7 @@ proc semOverride(c: PContext, s: PSym, n: PNode) =
|
|||
else: break
|
||||
if obj.kind in {tyObject, tyDistinct, tySequence, tyString}:
|
||||
obj = canonType(c, obj)
|
||||
if obj.destructor.isNil:
|
||||
if obj.destructor.isNil and tfCheckedForDestructor notin obj.flags:
|
||||
obj.attachedOps[attachedDestructor] = s
|
||||
else:
|
||||
prevDestructor(c, obj.destructor, obj, n.info)
|
||||
|
|
@ -1660,7 +1660,7 @@ proc semOverride(c: PContext, s: PSym, n: PNode) =
|
|||
obj = canonType(c, obj)
|
||||
#echo "ATTACHING TO ", obj.id, " ", s.name.s, " ", cast[int](obj)
|
||||
let k = if name == "=": attachedAsgn else: attachedSink
|
||||
if obj.attachedOps[k].isNil:
|
||||
if obj.attachedOps[k].isNil and tfCheckedForDestructor notin obj.flags:
|
||||
obj.attachedOps[k] = s
|
||||
else:
|
||||
prevDestructor(c, obj.attachedOps[k], obj, n.info)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue