-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Always discriminate contextual types by existing discriminant property #61097
base: main
Are you sure you want to change the base?
Always discriminate contextual types by existing discriminant property #61097
Conversation
@typescript-bot test it |
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: knockout
Package: react-dates
|
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
fixes #58508
fixes #61095
I think the added
tests/cases/compiler/contextuallyTypedByDiscriminableUnion2.ts
test case tells it all (TS playground). Currently both property assignments that reference external values and shorthand property assignments are capable of narrowing this case but a property assignment with an "inline" initializer isn't.