Skip to content

fix(compiler): fix a few bugs with the newly introduced ** operator#60101

Closed
mmalerba wants to merge 3 commits intoangular:mainfrom
mmalerba:exp
Closed

fix(compiler): fix a few bugs with the newly introduced ** operator#60101
mmalerba wants to merge 3 commits intoangular:mainfrom
mmalerba:exp

Conversation

@mmalerba
Copy link
Copy Markdown
Contributor

@mmalerba mmalerba commented Feb 25, 2025

Some fixes for exponentiation which was recently introduced in #59894

  • Makes exponentiation right-associative. For example, a ** b ** c should be equivalent to a ** (b ** c), not (a ** b) ** c
  • Ensures that required parentheses are preserved in the compiled output. Parentheses are required when a unary operator is used in the base of the exponentiation, for example (-1) ** 3

@mmalerba mmalerba added the target: major This PR is targeted for the next major release label Feb 25, 2025
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Feb 25, 2025
@ngbot ngbot Bot added this to the Backlog milestone Feb 25, 2025
Comment thread packages/compiler-cli/src/ngtsc/translator/src/translator.ts Outdated
@mmalerba mmalerba requested a review from crisbeto February 26, 2025 00:28
Comment thread packages/compiler-cli/src/ngtsc/translator/src/translator.ts Outdated
Comment thread packages/compiler-cli/src/ngtsc/translator/src/translator.ts Outdated
For example, `a ** b ** c` should be equivalent to `a ** (b ** c)`,
not `(a ** b) ** c`
…ions

Parentheses are required around a unary operator used in the base of an
exponentiation expression. For example: `(-1) ** 3`
Handle typeof and void expressions the same way as other unary operator
expressions.
@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Feb 28, 2025
@mmalerba
Copy link
Copy Markdown
Contributor Author

This PR was merged into the repository by commit b70ad3c.

The changes were merged into the following branches: main

@mmalerba mmalerba closed this in 4fe489f Feb 28, 2025
mmalerba added a commit that referenced this pull request Feb 28, 2025
…ions (#60101)

Parentheses are required around a unary operator used in the base of an
exponentiation expression. For example: `(-1) ** 3`

PR Close #60101
mmalerba added a commit that referenced this pull request Feb 28, 2025
…#60101)

Handle typeof and void expressions the same way as other unary operator
expressions.

PR Close #60101
@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 Mar 31, 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: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants