fixes #186 and the ttypedesc1 test case

This commit is contained in:
Zahary Karadjov 2012-09-23 19:33:54 +03:00
commit 27dc9fcb8f
5 changed files with 30 additions and 28 deletions

View file

@ -431,7 +431,7 @@ proc TypeToString(typ: PType, prefer: TPreferedDesc = preferName): string =
add(result, typeToString(t.sons[i]))
add(result, ']')
of tyTypeDesc:
if t.sons.len == 0: result = "typedesc"
if t.sons == nil or t.sons.len == 0: result = "typedesc"
else: result = "typedesc[" & constraintsToStr(t) & "]"
of tyTypeClass:
result = constraintsToStr(t)