Destructor lifting fixes #11149 (#11163)

* fixes #11149

* add test
This commit is contained in:
cooldome 2019-05-04 22:34:37 +02:00 • committed by Andreas Rumpf
commit d3db189eb4
4 changed files with 77 additions and 10 deletions

View file

@ -325,7 +325,7 @@ proc genOp(c: Con; t: PType; kind: TTypeAttachedOp; dest, ri: PNode): PNode =
if op == nil:
# give up and find the canonical type instead:
let h = sighashes.hashType(t, {CoType, CoConsiderOwned})
let h = sighashes.hashType(t, {CoType, CoConsiderOwned, CoDistinct})
let canon = c.graph.canonTypes.getOrDefault(h)
if canon != nil:
op = canon.attachedOps[kind]