fixed macros.getTypeImpl for a symbol of type tyGenericBody (#5788) (#5812)

* fixed macros.getTypeImpl for a symbol of type tyGenericBody
* added test case and commented test code
This commit is contained in:
jcosborn 2017-05-14 08:08:41 -05:00 • committed by Andreas Rumpf
commit ec50dab57d
3 changed files with 57 additions and 21 deletions

View file

@ -175,7 +175,12 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
result.add mapTypeToAst(t.sons[i], info)
else:
result = mapTypeToAstX(t.lastSon, info, inst, allowRecursion)
of tyGenericBody, tyOrdinal:
of tyGenericBody:
if inst:
result = mapTypeToAstX(t.lastSon, info, inst, true)
else:
result = mapTypeToAst(t.lastSon, info)
of tyOrdinal:
result = mapTypeToAst(t.lastSon, info)
of tyDistinct:
if inst: