Skip to content

fix(compiler): parsing of an empty template literal interpolation#69706

Open
hawkgs wants to merge 2 commits into
angular:mainfrom
hawkgs:compiler/tl-interpolation-fix
Open

fix(compiler): parsing of an empty template literal interpolation#69706
hawkgs wants to merge 2 commits into
angular:mainfrom
hawkgs:compiler/tl-interpolation-fix

Conversation

@hawkgs

@hawkgs hawkgs commented Jul 9, 2026

Copy link
Copy Markdown
Member

A minor fix.

Even if we have an EmptyExpr, add that expression to the expressions array when a literal is parsed. The lack of the expression results in a discrepancy in the sizes of the elements and the expressions arrays of a TemplateLiteral, that leads to an error when we visit that same literal due to the missing expression.

Fixes #69699

Additionally, I've added a test to the language service, just in case, that ensures the scenario is handled gracefully.

hawkgs added 2 commits July 9, 2026 12:56
Even if we have an `EmptyExpr`, add that expression to the expressions array when a literal is parsed.
The lack of the expression results in a discrepancy in the sizes of the `elements` and the `expressions`
arrays of a `TemplateLiteral`, that result in an error when we visit that same literal due to the missing
expression.

Fixes angular#69699
Ensure that empty template literal interpolation is handled gracefully.
@hawkgs hawkgs requested a review from crisbeto July 9, 2026 10:11
@hawkgs hawkgs added area: language-service Issues related to Angular's VS Code language service area: compiler Issues related to `ngc`, Angular's template compiler labels Jul 9, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jul 9, 2026
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jul 9, 2026
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 area: language-service Issues related to Angular's VS Code language service target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular Language Service crashes when there is an empty template literal interpolation

3 participants