summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-03-07 12:55:30 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-03-07 12:55:30 +0100
commit0a93cf6fb9c0eabaae20a5dc092321cb828edd62 (patch)
treee88a2d10d54a4a6d2260bcfef553964f768e49bb
parent5b1a2eecd533b607240b1d74544e950f22afcffb (diff)
downloadNim-0a93cf6fb9c0eabaae20a5dc092321cb828edd62.tar.gz
fixes the regression
-rw-r--r--compiler/semexprs.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 89cc53e1f..91ee2aae8 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)