summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorVarriount <Varriount@users.noreply.github.com>2018-04-27 15:35:41 -0400
committerAndreas Rumpf <rumpf_a@web.de>2018-04-27 21:35:41 +0200
commit822d2b5085f503a1802dd2c77d6348ffe53e4d37 (patch)
tree98e8dd863d34f49892454416328845fda11f3cde /compiler
parent7c538b26ad03b077da84766771b85d72d978b598 (diff)
downloadNim-822d2b5085f503a1802dd2c77d6348ffe53e4d37.tar.gz
Fix the return value of GetType and friends when given a `var T` type. (#7701)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmdeps.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim
index 071cc7706..ba37237e8 100644
--- a/compiler/vmdeps.nim
+++ b/compiler/vmdeps.nim
@@ -208,7 +208,12 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
       result.add mapTypeToAst(t.sons[0], info)
     else:
       result = mapTypeToBracket("ref", mRef, t, info)
-  of tyVar: result = mapTypeToBracket("var", mVar, t, info)
+  of tyVar:
+    if inst:
+      result = newNodeX(nkVarTy)
+      result.add mapTypeToAst(t.sons[0], info)
+    else:
+      result = mapTypeToBracket("var", mVar, t, info)
   of tyLent: result = mapTypeToBracket("lent", mBuiltinType, t, info)
   of tySink: result = mapTypeToBracket("sink", mBuiltinType, t, info)
   of tySequence: result = mapTypeToBracket("seq", mSeq, t, info)