-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify error messages against intersections of weak types #24146
Labels
Domain: Error Messages
The issue relates to error messaging
Experience Enhancement
Noncontroversial enhancements
Suggestion
An idea for TypeScript
Milestone
Comments
DanielRosenwasser
changed the title
Simplify elaboration against intersections with weak types
Simplify error messages against intersections with weak types
May 15, 2018
DanielRosenwasser
changed the title
Simplify error messages against intersections with weak types
Simplify error messages against intersections of weak types
May 15, 2018
Keep in mind that this needs to be tested against an intersection that consists of nothing but intersection types. We should never fall back to |
DanielRosenwasser
added
Suggestion
An idea for TypeScript
In Discussion
Not yet reached consensus
labels
May 16, 2018
@DanielRosenwasser I think you mean an intersection that consists of nothing but weak types. |
This was referenced Jun 22, 2018
11 tasks
RyanCavanaugh
added
Experience Enhancement
Noncontroversial enhancements
and removed
In Discussion
Not yet reached consensus
labels
Jul 29, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Domain: Error Messages
The issue relates to error messaging
Experience Enhancement
Noncontroversial enhancements
Suggestion
An idea for TypeScript
I spoke a bit with @sandersn about ways we can tackle the type madness issue (#14662). I noted that JSX scenarios are much more broadly applicable right now and are pretty prevalent given the sorts of type arithmetic we see a lot of in the React community. 😃
Problem: JSX optional attributes make errors too hard to read
Proposal
When doing relation checks against an intersection target, if a check fails, see if relating against the same type with weak types removed would result in the same outcome. If so, use that comparison when elaborating types.
The great part is that this actually solves a broader set of problems than just JSX.
The text was updated successfully, but these errors were encountered: