refactor(compiler-cli): Add report readonly signals in two-way bindings#67199
Open
SkyZeroZx wants to merge 1 commit intoangular:mainfrom
Open
refactor(compiler-cli): Add report readonly signals in two-way bindings#67199SkyZeroZx wants to merge 1 commit intoangular:mainfrom
SkyZeroZx wants to merge 1 commit intoangular:mainfrom
Conversation
Adds a diagnostic error when a read-only signal is used in a two-way binding. Fixes angular#67188
SkyZeroZx
commented
Feb 22, 2026
| @Component({ | ||
| template: \` | ||
| @let templateComputed = computedValue; |
Contributor
Author
There was a problem hiding this comment.
I’m wondering whether should be here or in the @let type check , i think should be there, since it’s for two-way binding
JeanMeche
reviewed
Feb 23, 2026
Comment on lines
+392
to
+395
| expect(diags[2].messageText).toBe( | ||
| `Cannot use read-only signal 'value' in a two-way binding expression. Two-way bindings require a \`WritableSignal\`.`, | ||
| ); | ||
| }); |
Member
There was a problem hiding this comment.
We're adding an unecessary diagnostic here.
Should we only send it when we have an any type on the 2 way binding ? (because the typechecking system is able to catch the mismatch in the other cases).
Member
|
Also this change is breaking in G3: Which is probably a true positive, since is way binded to an |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a diagnostic error when a read-only signal is used in a two-way binding.
Fixes #67188
What is the current behavior?
What is the new behavior?
Now throw exception like