-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
When relating A<Foo> to A<Bar> | B<Baz> | C<Kwah>, if the check fails, it is highly likely that the user wants to see the elaboration from A<Foo> to A<Bar>, rather than for A<Foo> to B<Baz> or A<Foo> to C<Kwah>.
We should try to find candidates when source types are type references, and target types are unions.
As a real-world example, here's an error message where TypeScript had the chance to relate ComponentClass<...> to ComponentClass<...> | StatelessComponent<...>:
https://news.ycombinator.com/item?id=17244638
This should also work for if two types have a well-known type alias.
Vaguely related to #6541?
omril1 and cliffkoh
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingFixedA PR has been merged for this issueA PR has been merged for this issue
