fix(compiler): allow safe navigation to correctly narrow down nullables - #67959
Merged
Conversation
JeanMeche
force-pushed
the
safe-navigation-narrow
branch
2 times, most recently
from
April 3, 2026 01:22
ecf9bad to
441aa96
Compare
JeanMeche
force-pushed
the
safe-navigation-narrow
branch
5 times, most recently
from
April 7, 2026 08:25
3a478f1 to
2715b40
Compare
JeanMeche
marked this pull request as ready for review
April 7, 2026 09:22
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
Member
Author
|
G3 update was submitted |
crisbeto
approved these changes
Apr 8, 2026
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 8, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
14 tasks
JeanMeche
force-pushed
the
safe-navigation-narrow
branch
from
April 8, 2026 17:08
2715b40 to
874a83e
Compare
JeanMeche
force-pushed
the
safe-navigation-narrow
branch
from
April 8, 2026 18:26
874a83e to
1d0d46b
Compare
JeanMeche
force-pushed
the
safe-navigation-narrow
branch
from
April 8, 2026 18:44
1d0d46b to
b1bcdc2
Compare
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 8, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 8, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
The commit updates the TCB for safe navigation expressions to allow for correct narrowing of nullables. This will trigger the `nullishCoalescingNotNullable` and `optionalChainNotNullable` diagnostics on exisiting projects. You might want to disable those 2 diagnotiscs in your `tsconfig` temporarily if you want to update your project without having to fix all the issues at once. Narrowing can be disabled altogether with `strictSafeNavigationTyes: false`. fixes angular#37619 BREAKING CHANGE: This change will trigger the `nullishCoalescingNotNullable` and `optionalChainNotNullable` diagnostics on exisiting projects. You might want to disable those 2 diagnotiscs in your `tsconfig` temporarily.
JeanMeche
force-pushed
the
safe-navigation-narrow
branch
from
April 9, 2026 12:40
b1bcdc2 to
ee5e6d7
Compare
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
Contributor
|
I'm merging this because TGP passed, and presubmit also passed, but we had to change a commit message. |
Contributor
|
This PR was merged into the repository. The changes were merged into the following branches:
|
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 9, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
aparzi
added a commit
to aparzi/angular
that referenced
this pull request
Apr 11, 2026
…ainNotNullable on ng update Related to angular#67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
kirjs
pushed a commit
that referenced
this pull request
Apr 13, 2026
…ainNotNullable on ng update Related to #67959 disabling two diagnostics errors by `ng update`: - nullishCoalescingNotNullable - optionalChainNotNullable
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The commit updates the TCB for safe navigation expressions to allow for correct narrowing of nullables.
This will trigger the
nullishCoalescingNotNullableandoptionalChainNotNullablediagnostics on exisiting projects.You might want to disable those 2 diagnotiscs in your
tsconfigtemporarily if you want to update your project without having to fix all the issues at once.Narrowing can be disabled altogether with
strictSafeNavigationTyes: false.fixes #37619
BREAKING CHANGE: This change will trigger the
nullishCoalescingNotNullableandoptionalChainNotNullablediagnostics on exisiting projects.You might want to disable those 2 diagnotiscs in your
tsconfigtemporarily.The migration for disabling
nullishCoalescingNotNullable&optionalChainNotNullableonng updatewill be added on a follow-up PR.