- Notifications
You must be signed in to change notification settings - Fork13.2k
Improve intersection reduction and CFA for truthy, equality, and typeof checks#49119
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
32 commits Select commitHold shift + click to select a range
ce23b8d Improve reduction of intersection types
ahejlsbergffe147e Accept new baselines
ahejlsberga95de48 Merge branch 'main' into improveIntersectionReduction
ahejlsberg29edef1 Improve CFA for truthy, equality, and typeof checks
ahejlsberg39326d7 Accept new baselines
ahejlsbergd0b7ec8 Remove special case for Function type
ahejlsberga25388d Merge branch 'main' into improveIntersectionReduction
ahejlsberg95c3c56 Don't reduce intersections of form {...} & object
ahejlsberg986963c Accept new baselines
ahejlsbergc400181 Anything is assignable to unknown-like union
ahejlsbergf1ebcdd Accept new baselines
ahejlsberg73c91fd Tweak subtype check
ahejlsberg722c462 Recombine unknown type from unknown-like union in more cases
ahejlsberg5e1111a Display union origin only if it is shorter than union itself
ahejlsberg5c579a4 Accept new baselines
ahejlsberg8913cf0 Add tests
ahejlsbergdbce210 Only attach origin type when it is shorter than union itself
ahejlsberg1913c94 Specially preserve string & {}, number & {}, bigint & {}
ahejlsberg8c7a38b Accept new baselines
ahejlsberg6f18e90 Add additional tests
ahejlsberge70bf7c Fix getNormalizedType and getNarrowableTypeForReference for intersect…
ahejlsberg7a62983 Switch NonNullable<T> to use T & {}
ahejlsbergc35cba7 Accept new baselines
ahejlsberga0c0929 Use NonNullable<T> in place of anonymous T & {}
ahejlsbergeff3be3 Accept new baselines
ahejlsbergd3eb84f Add fourslash test
ahejlsberg954e80a More fourslash tests
ahejlsberg1d9b53f Fix getFalsyFlags handling of intersections
ahejlsberg3815934 Accept new baselines
ahejlsbergbfa3a90 Add constraint to compareProperties type parameter
ahejlsberg9801667 Unconstrained type parameter not assignable to {} with strictNullChecks
ahejlsberg51da289 Accept new baselines
ahejlsbergFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Improve CFA for truthy, equality, and typeof checks
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit29edef115cc190ab5df15e11fb50a52e0a8a8e7c
There are no files selected for viewing
79 changes: 48 additions & 31 deletionssrc/compiler/checker.ts
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.