Expand tyAlias in typeToString (#8634)

Fixes #8339
This commit is contained in:
LemonBoy 2018-08-18 15:27:47 +02:00 • committed by Andreas Rumpf
commit b5171f57ef
2 changed files with 10 additions and 0 deletions

View file

@ -426,6 +426,8 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string =
sfAnon notin t.sym.flags:
if t.kind == tyInt and isIntLit(t):
result = t.sym.name.s & " literal(" & $t.n.intVal & ")"
elif t.kind == tyAlias:
result = typeToString(t.sons[0])
elif prefer in {preferName, preferTypeName} or t.sym.owner.isNil:
result = t.sym.name.s
if t.kind == tyGenericParam and t.sonsLen > 0: