@@ -703,12 +703,14 @@ def name(self, typ, depth=0, max_depth=1):
703
703
elif isinstance(typ, TInstance):
704
704
if typ in self.recurse_guard or depth >= max_depth:
705
705
return "<instance {}>".format(typ.name)
706
- else :
706
+ elif len(typ.attributes) > 0 :
707
707
self.recurse_guard.add(typ)
708
708
attrs = ",\n\t\t".join(["{}: {}".format(attr, self.name(typ.attributes[attr],
709
709
depth + 1))
710
710
for attr in typ.attributes])
711
711
return "<instance {} {{\n\t\t{}\n\t}}>".format(typ.name, attrs)
712
+ else:
713
+ return "<instance {} {{}}>".format(typ.name)
712
714
elif isinstance(typ, TMono):
713
715
if typ.params == {}:
714
716
return typ.name
@@ -745,12 +747,14 @@ def name(self, typ, depth=0, max_depth=1):
745
747
elif isinstance(typ, (TConstructor, TExceptionConstructor)):
746
748
if typ in self.recurse_guard or depth >= max_depth:
747
749
return "<constructor {}>".format(typ.name)
748
- else :
750
+ elif len(typ.attributes) > 0 :
749
751
self.recurse_guard.add(typ)
750
752
attrs = ", ".join(["{}: {}".format(attr, self.name(typ.attributes[attr],
751
753
depth + 1))
752
754
for attr in typ.attributes])
753
755
return "<constructor {} {{{}}}>".format(typ.name, attrs)
756
+ else:
757
+ return "<constructor {} {{}}>".format(typ.name)
754
758
elif isinstance(typ, TBuiltin):
755
759
return "<builtin {}>".format(typ.name)
756
760
elif isinstance(typ, TValue):
0 commit comments