diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 89cc53e1f5..91ee2aae8b 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -227,7 +227,8 @@ 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 + if targetType.kind == tyOwned: + t.flags.incl tfHasOwned t.rawAddSonNoPropagationOfTypeFlags baseType result = newNodeI(nkType, n.info) result.typ = makeTypeDesc(c, t)