From 822d2b5085f503a1802dd2c77d6348ffe53e4d37 Mon Sep 17 00:00:00 2001 From: Varriount Date: Fri, 27 Apr 2018 15:35:41 -0400 Subject: Fix the return value of GetType and friends when given a `var T` type. (#7701) --- compiler/vmdeps.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler') 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) -- cgit 1.4.1-2-gfad0