-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Optimize checking involving large discriminated union types #42556
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 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d15a94f
No array literal subtype reduction when contextual type is present
ahejlsberg cb2d36e
Accept new baselines
ahejlsberg 216266b
Fast path in relations and filtering of pure discriminated union types
ahejlsberg 9e8f24b
Create maps for mixed unions, but not for small or primitive only unions
ahejlsberg af9552d
Create many-to-many mapping with certain limits, also use in CFA
ahejlsberg 0510f8a
Use constituent maps in CFA for switch statements, cleanup, add comments
ahejlsberg 6bb2fcb
Merge branch 'master' into fix42522
ahejlsberg 3a57384
Revert change to apparent contextual type / better criteria for map e…
ahejlsberg 6d04025
Deduplicate array literal element types
ahejlsberg 1597be8
Accept new baselines
ahejlsberg 9e2013c
Filter in false case only when discriminant property has unit type
ahejlsberg 7e1b99d
Merge branch 'master' into fix42522
ahejlsberg 0b62483
Only subtype reduce unions with less than 100 distinct types
ahejlsberg 781c1d7
Accept new baselines
ahejlsberg 538b5c8
Caching and quick discriminant checks in subtype reduction
ahejlsberg 3d6dbf4
Accept new baselines
ahejlsberg d282c70
Merge branch 'master' into fix42522
ahejlsberg a18aac2
Remove deduplication logic now that subtype reduction was optimized
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
Prev
Previous commit
Remove deduplication logic now that subtype reduction was optimized
- Loading branch information
commit a18aac27c604a85de6dd4f219619870fa5545392
There are no files selected for viewing
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
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.
As-is, I think this'd intern
{ set a(x: string) {} }and{ get a(){ return ""; } }to the same type, even though the later has areadonly a. Maybe just encoding the symbol flags wholesale in the key will be the most future proof thing, and then you can just join the names with,and not worry about the name length list thing.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.
Yeah, I'll look to make sure we properly preserve that distinction. The name length list is still needed since property names can contain any character, including any separator we might use to separate them.