owned refs must be moved

This commit is contained in:
Andreas Rumpf 2019-03-07 12:48:59 +01:00
commit 5b1a2eecd5
4 changed files with 8 additions and 27 deletions

View file

@ -227,6 +227,7 @@ proc semConv(c: PContext, n: PNode): PNode =
if targetType.kind in {tySink, tyLent, tyOwned}:
let baseType = semTypeNode(c, n.sons[1], nil).skipTypes({tyTypeDesc})
let t = newTypeS(targetType.kind, c)
t.flags.incl tfHasOwned
t.rawAddSonNoPropagationOfTypeFlags baseType
result = newNodeI(nkType, n.info)
result.typ = makeTypeDesc(c, t)