-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Reduce intersections by discriminants #36696
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
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
ace0904
Treat never-like intersections as never
ahejlsberg eaf872c
Accept new baselines
ahejlsberg 94353d2
Fix compiler issues revealed by increased intersection correctness
ahejlsberg 346ec30
Delete fourslash tests that are no longer applicable
ahejlsberg acd3fec
Include isNeverLikeIntersection check in getNormalizedType
ahejlsberg 7ae4a21
Erase never-like types in several more places
ahejlsberg 3a1ba48
Check that base types are not never-like
ahejlsberg e1434a5
Add comments
ahejlsberg 37c6280
Revert isNeverLikeType check in getIndexType (keyof shouldn't resolve…
ahejlsberg dba1043
Introduce getReducedType for union and intersection types
ahejlsberg f170191
Don't reduce in getApparentType
ahejlsberg 6b2f3a2
Avoid relationship check in resolveMappedTypeMembers
ahejlsberg aeab6af
Merge branch 'master' into neverLikeIntersections
ahejlsberg 4f67910
Accept new baselines
ahejlsberg 49302f2
Don't call getReducedType in getIndexType
ahejlsberg aa8d227
Ensure reduced and unreduced forms of a type can compare identical
ahejlsberg 8907e92
Reduce types before converting them to string representation
ahejlsberg 04facee
Accept new baselines
ahejlsberg 88be5ea
Reduce intersections before obtaining keyof X
ahejlsberg fbf13dc
Add tests
ahejlsberg 85447a5
Accept new baselines
ahejlsberg 7741085
Fix comment in tests
ahejlsberg d2b3807
Don't infer from empty intersection types
ahejlsberg 6590e20
Add tests
ahejlsberg 40340ae
Accept new baselines
ahejlsberg c4c1418
Defer instantiation of mapped type property types
ahejlsberg 8eb08e8
Accept new baselines
ahejlsberg 874938c
Merge branch 'master' into neverLikeIntersections
ahejlsberg ede9d01
Include more precise type in diagnostic
ahejlsberg 42022f3
Accept new baselines
ahejlsberg e24b250
Minor optimization
ahejlsberg 12f6224
Merge branch 'master' into neverLikeIntersections
ahejlsberg a015ab9
Improve error message
ahejlsberg 95ecb7b
Merge branch 'master' into neverLikeIntersections
ahejlsberg b99b9b2
Optional properties in intersections are never discriminants
ahejlsberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? Related?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what your question is here? With the improved precision of intersections, the checker was proving that this expression could never be true.