fix(compiler-cli): handle inline type-check blocks in nullish coalescing extended check#45454
Closed
JoostK wants to merge 3 commits intoangular:masterfrom
Closed
fix(compiler-cli): handle inline type-check blocks in nullish coalescing extended check#45454JoostK wants to merge 3 commits intoangular:masterfrom
JoostK wants to merge 3 commits intoangular:masterfrom
Conversation
atscott
approved these changes
Mar 29, 2022
Inline type check blocks (TCBs) are emitted into the original source file, but node positions would still be represented as a `ShimLocation` with a `shimPath` corresponding with the type-checking shim file. This results in inconsistencies, as the `positionInShimFile` field of `ShimLocation` would not correspond with the `shimPath` of that `ShimLocation`. This commit is a precursor to letting `ShimLocation` also represent the correct location for inline type check blocks, by renaming the interface to `TcbLocation`. A followup commit addresses the actual inconsistency.
…h a shim file Extends `TcbPosition` with a field that indicates whether the `tcbPath` is a type-checking shim file, or an original source file with an inline type check block. This field is used in an upcoming commit that fixes an inconsistency with how inline type check blocks are incorrectly interpreted as a type-checking shim file instead.
…ing extended check This commit fixes an inconsistency where a type check location for an inline type check block would be interpreted to occur in a type-checking shim instead. This resulted in a missing template mapping, causing a crash due to an unsafe non-null assertion operator. In the prior commit the `TcbLocation` has been extended with an `isShimFile` field that is now being used to look for the template mapping in the correct location. Additionally, the non-null assertion operator is refactored such that a missing template mapping will now ignore the warning instead of crashing the compiler. Fixes angular#45413
73341d8 to
14b32fe
Compare
Contributor
Member
Author
|
Merge assistance: please check the presubmit failure for me and merge if it's a flake. |
Contributor
|
Indeed, this is a flake. |
Contributor
|
This PR was merged into the repository by commit 06050ac. |
dylhunn
pushed a commit
that referenced
this pull request
Mar 29, 2022
…h a shim file (#45454) Extends `TcbPosition` with a field that indicates whether the `tcbPath` is a type-checking shim file, or an original source file with an inline type check block. This field is used in an upcoming commit that fixes an inconsistency with how inline type check blocks are incorrectly interpreted as a type-checking shim file instead. PR Close #45454
dylhunn
pushed a commit
that referenced
this pull request
Mar 29, 2022
…ing extended check (#45454) This commit fixes an inconsistency where a type check location for an inline type check block would be interpreted to occur in a type-checking shim instead. This resulted in a missing template mapping, causing a crash due to an unsafe non-null assertion operator. In the prior commit the `TcbLocation` has been extended with an `isShimFile` field that is now being used to look for the template mapping in the correct location. Additionally, the non-null assertion operator is refactored such that a missing template mapping will now ignore the warning instead of crashing the compiler. Fixes #45413 PR Close #45454
Contributor
|
This PR has conflicts with 13.3.x, but I've merged it into master. It would need a patch port if the patch branch is desired. |
josmar-crwdstffng
pushed a commit
to josmar-crwdstffng/angular
that referenced
this pull request
Apr 8, 2022
…ar#45454) Inline type check blocks (TCBs) are emitted into the original source file, but node positions would still be represented as a `ShimLocation` with a `shimPath` corresponding with the type-checking shim file. This results in inconsistencies, as the `positionInShimFile` field of `ShimLocation` would not correspond with the `shimPath` of that `ShimLocation`. This commit is a precursor to letting `ShimLocation` also represent the correct location for inline type check blocks, by renaming the interface to `TcbLocation`. A followup commit addresses the actual inconsistency. PR Close angular#45454
|
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.

This commit fixes an inconsistency where a type check location for an inline
type check block would be interpreted to occur in a type-checking shim instead.
This resulted in a missing template mapping, causing a crash due to an unsafe
non-null assertion operator.
In the prior commit the
TcbLocationhas been extended with anisShimFilefield that is now being used to look for the template mapping in the correct
location. Additionally, the non-null assertion operator is refactored such
that a missing template mapping will now ignore the warning instead of crashing
the compiler.
Fixes #45413