back2dos / tinkerbell

MIT License
83 stars 8 forks source link

TypeTools.asTypePath - remove duplication when name == sub #36

Closed misprintt closed 11 years ago

misprintt commented 11 years ago

In some cases TypeTools.asTypePath returns a path where sub and name are the same. It is valid code, but adds a lot of clutter when printing out types.

It doesn't always happen, and is tricky to isolate, but I've seen this a lot when working when converting ClassFields to Fields, especially with types defined in StdTypes (e.g. String, Bool, Int, etc)

which means that printing a field that should look like

function foo():String

looks like this instead

function foo():String.String

This line patch sets sub to null if it is the same as name

back2dos commented 11 years ago

Sounds reasonable, thanks ;)