Skip to content

fix(compiler-cli): use switch statements to narrow Angular switch blocks#55168

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:switch-tcb-again
Closed

fix(compiler-cli): use switch statements to narrow Angular switch blocks#55168
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:switch-tcb-again

Conversation

@crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 2, 2024

In #52110 we had to use if statements to represent switch blocks, because TypeScript had a bug when narrowing the type of parenthesized switch statements. Now that it has been fixed by TypeScript and we don't support any version that has the broken behavior, we can go back to generating switch statements in the TCB which are simpler and better represent the user's code.

In angular#52110 we had to use `if` statements to represent `switch` blocks, because TypeScript had a bug when narrowing the type of parenthesized `switch` statements. Now that it has been fixed by TypeScript and we don't support any version that has the broken behavior, we can go back to generating `switch` statements in the TCB which are simpler and better represent the user's code.
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release area: compiler Issues related to `ngc`, Angular's template compiler labels Apr 2, 2024
@ngbot ngbot bot modified the milestone: Backlog Apr 2, 2024
@crisbeto crisbeto requested a review from JoostK April 2, 2024 12:26
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 2, 2024
@jessicajaniuk
Copy link
Contributor

This PR was merged into the repository by commit c04ffb1.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants