fix(compiler-cli): do not throw when retrieving TCB symbol for signal input with restricted access#55774
Closed
devversion wants to merge 1 commit intoangular:mainfrom
Closed
fix(compiler-cli): do not throw when retrieving TCB symbol for signal input with restricted access#55774devversion wants to merge 1 commit intoangular:mainfrom
devversion wants to merge 1 commit intoangular:mainfrom
Conversation
cexbrayat
approved these changes
May 13, 2024
packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.ts
Outdated
Show resolved
Hide resolved
… input with restricted access Currently when attempting to retrieve a TCB symbol for an input binding that refers to a signal input with e.g. `protected`, while the `honorAccessModifiersForInputBindings` flag is `false`, Angular will throw a runtime exception because the symbol retrieval code always expects a proper field access in the TCB. This is not the case with `honorAccessModifiersForInputBindings = false`, as TCB will allocate a temporary variable when ignoring the field access. This will then trigger the runtime exception (which we added to flag such "unexpected" cases). This commit handles it gracefully, as it's valid TCB, but we simply cannot generate a proper TCB symbol (yet). This is similar to `@Input` decorator inputs. In the future we may implement logic to build up TCB symbols for non-property access bindings, for both signal inputs or `@Input` inputs. This commit just avoids a build exception. Related to: angular#54324.
f6f0306 to
1ff8a06
Compare
crisbeto
approved these changes
May 16, 2024
Contributor
|
This PR was merged into the repository by commit 400911e. |
atscott
pushed a commit
that referenced
this pull request
May 16, 2024
… input with restricted access (#55774) Currently when attempting to retrieve a TCB symbol for an input binding that refers to a signal input with e.g. `protected`, while the `honorAccessModifiersForInputBindings` flag is `false`, Angular will throw a runtime exception because the symbol retrieval code always expects a proper field access in the TCB. This is not the case with `honorAccessModifiersForInputBindings = false`, as TCB will allocate a temporary variable when ignoring the field access. This will then trigger the runtime exception (which we added to flag such "unexpected" cases). This commit handles it gracefully, as it's valid TCB, but we simply cannot generate a proper TCB symbol (yet). This is similar to `@Input` decorator inputs. In the future we may implement logic to build up TCB symbols for non-property access bindings, for both signal inputs or `@Input` inputs. This commit just avoids a build exception. Related to: #54324. PR Close #55774
|
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.
Currently when attempting to retrieve a TCB symbol for an input binding that refers to a signal input with e.g.
protected, while thehonorAccessModifiersForInputBindingsflag isfalse, Angular will throw a runtime exception because the symbol retrieval code always expects a proper field access in the TCB.This is not the case with
honorAccessModifiersForInputBindings = false, as TCB will allocate a temporary variable when ignoring the field access. This will then trigger the runtime exception (which we added to flag such "unexpected" cases). This commit handles it gracefully, as it's valid TCB, but we simply cannot generate a proper TCB symbol (yet). This is similar to@Inputdecorator inputs.In the future we may implement logic to build up TCB symbols for non-property access bindings, for both signal inputs or
@Inputinputs. This commit just avoids a build exception.Related to: #54324.