Skip to content

fix(compiler): Keep paraenthesis in Nullish + Boolean expression. - #63292

Closed
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:compiler-parenthesis-regression
Closed

JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:compiler-parenthesis-regression

Conversation

@JeanMeche

@JeanMeche JeanMeche commented Aug 20, 2025 •

Copy link
Copy Markdown
Member

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

@thePunderWoman thePunderWoman left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member Author

TGP is "green"

@crisbeto

Copy link
Copy Markdown
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
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Sep 29, 2025
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: 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