modify getTypeImpl to reduce result to final implementation (#6891)

* added test case for getTypeImpl
* modify getTypeImpl to reduce result to final implementation
This commit is contained in:
jcosborn
2017-12-09 06:07:37 -06:00
committed by Andreas Rumpf
parent b87ef65532
commit 96a5062b8c
2 changed files with 15 additions and 5 deletions

View File

@@ -84,10 +84,10 @@ proc mapTypeToAstX(t: PType; info: TLineInfo;
if inst:
if t.sym != nil: # if this node has a symbol
if allowRecursion: # getTypeImpl behavior: turn off recursion
allowRecursion = false
else: # getTypeInst behavior: return symbol
if not allowRecursion: # getTypeInst behavior: return symbol
return atomicType(t.sym)
#else: # getTypeImpl behavior: turn off recursion
# allowRecursion = false
case t.kind
of tyNone: result = atomicType("none", mNone)