-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Per file option: strictNullChecks #50347
Conversation
@typescript-bot pack this |
Heya @weswigham, I've started to run the perf test suite on this PR at 171a3ee. You can monitor the build here. |
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 171a3ee. You can monitor the build here. |
Heya @weswigham, I've started to run the extended test suite on this PR at 171a3ee. You can monitor the build here. |
Heya @weswigham, I've started to run the tarball bundle task on this PR at 171a3ee. You can monitor the build here. |
Heya @weswigham, I've started to run the diff-based user code test suite on this PR at 171a3ee. You can monitor the build here. |
I've updated with |
Followup to #49886 that adds the missing
strictNullChecks
support. 171a3ee - the commit adding it - is probably larger than the rest of the PR combined, so it's probably worth reviewing separately. Plus, I definitely need to run extended test suites on this, given how much is mucks with howstrictNullChecks
works.Specifically,
strictNullChecks
now has no globally toggled behavior. Instead:undefined
andnull
are widening or non-widening depending on the strictness of the expression use site.undefined
andnull
are only syntactically excluded from unions in non-strict mode, rather than always being elided. This could be refined a bit to allow aliases to null/undefined or unions containing them, but I don't know how far that has to go to be reasonably compatible. This facilitates flowingnull
andundefined
from a strict mode file into a loose mode one and allowing working with them there.null
andundefined
from its branch results in non-strict contexts, to emulate the visible bits of the prior global union evaporation behavior.