Skip to content

Conversation

JeanMeche
Copy link
Member

@JeanMeche JeanMeche commented Aug 20, 2025

Ts 5.9 introduced a regression coming from 5.8 when parenthesis aren't generated for expressions like ((a ?? b) && c).
This fix works around this explicitly specifying that we want to keep those parenthesis that we're aware of in this specific case;

This change can be reverted if the root issue (microsoft/TypeScript#61369) is fixed. (but let's keep the tests in any case for the coverage)

fixes #63287

@JeanMeche JeanMeche force-pushed the compiler-parenthesis-regression branch from 3816081 to 49832a3 Compare August 20, 2025 22:25
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Aug 20, 2025
@ngbot ngbot bot added this to the Backlog milestone Aug 20, 2025
@JeanMeche JeanMeche changed the title WIP fix(compiler): Keep paraenthesis in Nullish + Boolean expression. Aug 20, 2025
@JeanMeche JeanMeche force-pushed the compiler-parenthesis-regression branch from 49832a3 to 074e948 Compare August 20, 2025 22:27
@JeanMeche JeanMeche marked this pull request as ready for review August 20, 2025 22:29
@JeanMeche JeanMeche requested a review from mmalerba August 20, 2025 22:29
@pullapprove pullapprove bot requested a review from thePunderWoman August 20, 2025 22:29
Ts 5.9 introduced a regression coming from 5.8 when parenthesis aren't generated for expressions like (`(a ?? b) && c`).
This fix works around this explicitly specifying that we want to keep those parenthesis that we're aware of in this specific case;

This change can be reverted if the root issue (microsoft/TypeScript#61369) is fixed. (but let's keep the tests in any case for the coverage)

fixes angular#63287
@JeanMeche JeanMeche force-pushed the compiler-parenthesis-regression branch from 074e948 to fdf999d Compare August 20, 2025 22:38
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thePunderWoman thePunderWoman added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Aug 21, 2025
@JeanMeche
Copy link
Member Author

TGP is "green"

@crisbeto
Copy link
Member

This PR was merged into the repository by commit 827c3c1.

The changes were merged into the following branches: main, 20.2.x

crisbeto pushed a commit that referenced this pull request Aug 21, 2025
…3292)

Ts 5.9 introduced a regression coming from 5.8 when parenthesis aren't generated for expressions like (`(a ?? b) && c`).
This fix works around this explicitly specifying that we want to keep those parenthesis that we're aware of in this specific case;

This change can be reverted if the root issue (microsoft/TypeScript#61369) is fixed. (but let's keep the tests in any case for the coverage)

fixes #63287

PR Close #63292
@crisbeto crisbeto closed this in 827c3c1 Aug 21, 2025
@JeanMeche JeanMeche deleted the compiler-parenthesis-regression branch August 29, 2025 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in 20.2 - New/incorrect build errors with 20.2 - Cannot use "||" with "??" without parentheses
4 participants