You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better display representation for intersection types #7705
I'm not sure if this has been discussed before, but join types are mostly unreadable. I think the type should be prettified somehow before being displayed to the user.
I suppose it's better to limit this to anonymous types, or else it could rapidly go out of control with "big" named types, and you'll lose some type information.
Accepting PRs, with a big caveat. This is actually quite a bit trickier than it appears because of how the compiler handles anonymous self-referential types. A PR here should be accompanied by a large test suite of recursively self-referential types to ensure there aren't any lingering runaway recursion bugs.
Activity
[-]Better join types display[/-][+]Better intersection display for intersection types[/+][-]Better intersection display for intersection types[/-][+]Better display representation for intersection types[/+]JabX commentedon Apr 13, 2016
👍
I use intersections a lot and I would love to have this feature.
mhegazy commentedon Apr 13, 2016
so just to be clear is the request 1. to remove the empty object type if exists, or 2. to collapse all types. i.e.:
louy commentedon Apr 13, 2016
The second actually.
mhegazy commentedon Apr 13, 2016
ok one more clarification, i assume this only applies to anonymous types. so 2.a would be the desired behavior.
JabX commentedon Apr 14, 2016
I suppose it's better to limit this to anonymous types, or else it could rapidly go out of control with "big" named types, and you'll lose some type information.
zpdDG4gta8XKpMCd commentedon Apr 22, 2016
related #6070
RyanCavanaugh commentedon May 9, 2016
Accepting PRs, with a big caveat. This is actually quite a bit trickier than it appears because of how the compiler handles anonymous self-referential types. A PR here should be accompanied by a large test suite of recursively self-referential types to ensure there aren't any lingering runaway recursion bugs.
See also comments in #8228.