Fix the return value of GetType and friends when given a var T type. (#7701)
This commit is contained in:
parent
7c538b26ad
commit
822d2b5085
1 changed files with 6 additions and 1 deletions
|
|
@ -208,7 +208,12 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
|
||||||
result.add mapTypeToAst(t.sons[0], info)
|
result.add mapTypeToAst(t.sons[0], info)
|
||||||
else:
|
else:
|
||||||
result = mapTypeToBracket("ref", mRef, t, info)
|
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 tyLent: result = mapTypeToBracket("lent", mBuiltinType, t, info)
|
||||||
of tySink: result = mapTypeToBracket("sink", mBuiltinType, t, info)
|
of tySink: result = mapTypeToBracket("sink", mBuiltinType, t, info)
|
||||||
of tySequence: result = mapTypeToBracket("seq", mSeq, t, info)
|
of tySequence: result = mapTypeToBracket("seq", mSeq, t, info)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue