fix(compiler-cli): don't type check the bodies of control flow nodes in basic mode#55360
fix(compiler-cli): don't type check the bodies of control flow nodes in basic mode#55360crisbeto wants to merge 1 commit intoangular:mainfrom
Conversation
2f052fa to
6ed2f1b
Compare
There was a problem hiding this comment.
I was debating whether to reuse checkTemplateBodies instead of introducing this one. I decided to do it since it's a bit more explicit.
There was a problem hiding this comment.
Yeah, I can go either way. I wouldn't personally have introduced it, but there's no harm in keeping it.
There was a problem hiding this comment.
Technically we don't need to skip the guard here since no children will be generated hence nothing will use it. I added the check here to avoid some of the work when we can.
6ed2f1b to
ab4283c
Compare
JoostK
left a comment
There was a problem hiding this comment.
One request for changing a test, other than that LGTM.
There was a problem hiding this comment.
Yeah, I can go either way. I wouldn't personally have introduced it, but there's no harm in keeping it.
packages/compiler-cli/src/ngtsc/typecheck/test/type_check_block_spec.ts
Outdated
Show resolved
Hide resolved
…in basic mode Angular only checks the contents of template nodes in full type checking mode. After v17, the new control flow always had its body checked, even in basic mode, which started revealing compilation errors for apps that were using the schematic to automatically switch to the new syntax. These changes mimic the old behavior by not checking the bodies of `if`, `switch` and `for` blocks in basic mode. Note that the expressions of the blocks are still going to be checked. Fixes angular#52969.
ab4283c to
2d06014
Compare
|
This PR was merged into the repository by commit 7a16d7e. |
|
Could this fix be included in v17 as well? |
|
v17 port is in #55558. |
|
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. |
Angular only checks the contents of template nodes in full type checking mode. After v17, the new control flow always had its body checked, even in basic mode, which started revealing compilation errors for apps that were using the schematic to automatically switch to the new syntax.
These changes mimic the old behavior by not checking the bodies of
if,switchandforblocks in basic mode. Note that the expressions of the blocks are still going to be checked.Fixes #52969.