summary refs log tree commit diff stats
path: root/compiler/semmagic.nim
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2019-12-05 06:38:12 +0000
committerAndreas Rumpf <rumpf_a@web.de>2019-12-05 07:38:12 +0100
commit0987872675b2a677327a0ac7bec2fa24b002a73e (patch)
treefce274f5e8548112b2abb9d10c8418bf26ca7720 /compiler/semmagic.nim
parentde1a2833836701c87021330ea8a9f324e673f13b (diff)
downloadNim-0987872675b2a677327a0ac7bec2fa24b002a73e.tar.gz
fixes #12804 (#12809)
Diffstat (limited to 'compiler/semmagic.nim')
-rw-r--r--compiler/semmagic.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index 3e5c385e9..307e21ec6 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -147,11 +147,11 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
       let preferStr = traitCall[2].strVal
       prefer = parseEnum[TPreferedDesc](preferStr)
     result = newStrNode(nkStrLit, operand.typeToString(prefer))
-    result.typ = newType(tyString, context)
+    result.typ = getSysType(c.graph, traitCall[1].info, tyString)
     result.info = traitCall.info
   of "name", "$":
     result = newStrNode(nkStrLit, operand.typeToString(preferTypeName))
-    result.typ = newType(tyString, context)
+    result.typ = getSysType(c.graph, traitCall[1].info, tyString)
     result.info = traitCall.info
   of "arity":
     result = newIntNode(nkIntLit, operand.len - ord(operand.kind==tyProc))