Fix the return value of GetType and friends when given a var T type. (#7701)

This commit is contained in:
Varriount
2018-04-27 15:35:41 -04:00
committed by Andreas Rumpf
parent 7c538b26ad
commit 822d2b5085

View File

@@ -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)