-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Allow implicit undefined
returns when the contextual union type contains it
#57912
base: main
Are you sure you want to change the base?
Allow implicit undefined
returns when the contextual union type contains it
#57912
Conversation
@typescript-bot test top400 @typescript-bot perf test this faster |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: nodes7
|
@jakebailey Here are the results of running the user tests comparing Everything looks good! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
I think there's a possible parsing ambiguity in the referenced comment
|
@jakebailey Here are the results of running the top 400 repos comparing Everything looks good! |
The single reported failure here comes from those lines here. We can quickly verify on this TS playground that the contextual type of this function is |
…turn-contextual-union # Conflicts: # tests/baselines/reference/functionsMissingReturnStatementsAndExpressionsStrictNullChecks.types # tests/baselines/reference/inferenceDoesNotAddUndefinedOrNull.types
fixes #57840
@RyanCavanaugh triaged this as a bug here. I'm pretty sure that @ahejlsberg didn't want this to work this way though (as per the description of #53607 and the comment in tests that I had to touch here).