Skip to content

fix(angular): fix 3 compiler divergences from Angular reference#27

Merged
Brooooooklyn merged 1 commit intomainfrom
fix/angular-3-compiler-divergences
Feb 22, 2026
Merged

fix(angular): fix 3 compiler divergences from Angular reference#27
Brooooooklyn merged 1 commit intomainfrom
fix/angular-3-compiler-divergences

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 22, 2026

  1. @for duplicate let validation: Remove extra name != value condition
    that skipped implicit context variables, causing let $index = $index
    to be silently accepted instead of rejected as a duplicate.

  2. $index alias handling: Change RepeaterVarNames.index from Option<Atom>
    to Vec<Atom> so multiple aliases for $index (e.g. let i = $index, j = $index) are all stored and rewritten in track expressions, matching
    Angular's Set<string> behavior.

  3. @switch invalid @case unknown_blocks: Push invalid @case blocks (wrong
    parameter count) into unknown_blocks before continuing, matching
    Angular's behavior for language service autocompletion support.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Medium Risk
Touches control-flow transform and repeater track-expression rewriting, which can change generated output and error surfaces for @for/@switch templates. Changes are narrow and covered by new regression tests.

Overview
Aligns @for parsing/ingestion with Angular by treating any repeated let name as a duplicate (including implicit context vars like $index), so invalid declarations now error instead of being accepted.

Fixes repeater $index alias tracking by storing all aliases (not just one) and using them when rewriting track expressions, ensuring multiple $index aliases are correctly transformed.

Updates @switch transformation so invalid @case blocks (wrong parameter count) are still recorded in unknown_blocks before being skipped, matching Angular’s language-service behavior. Adds focused regression tests for these cases.

Written by Cursor Bugbot for commit e5c6964. This will update automatically on new commits. Configure here.

1. @for duplicate `let` validation: Remove extra `name != value` condition
   that skipped implicit context variables, causing `let $index = $index`
   to be silently accepted instead of rejected as a duplicate.

2. $index alias handling: Change `RepeaterVarNames.index` from `Option<Atom>`
   to `Vec<Atom>` so multiple aliases for $index (e.g. `let i = $index,
   j = $index`) are all stored and rewritten in track expressions, matching
   Angular's `Set<string>` behavior.

3. @switch invalid @case unknown_blocks: Push invalid @case blocks (wrong
   parameter count) into `unknown_blocks` before continuing, matching
   Angular's behavior for language service autocompletion support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Brooooooklyn Brooooooklyn merged commit c801e94 into main Feb 22, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/angular-3-compiler-divergences branch February 22, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant