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
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
looks like this instead
This line patch sets sub to null if it is the same as name