Skip to content

fix(angular): fix 7 compiler divergences from Angular reference#26

Merged
Brooooooklyn merged 1 commit intomainfrom
fix/angular-compiler-review-items
Feb 22, 2026
Merged

fix(angular): fix 7 compiler divergences from Angular reference#26
Brooooooklyn merged 1 commit intomainfrom
fix/angular-compiler-review-items

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 21, 2026

  1. Add missing @switch validation: report errors for non-block children,
    enforce exactly one @case parameter, single @default, and no @default
    parameters
  2. Carry viewport trigger options through ingest into DeferOnOp IR
  3. Change generateArrowFunctions phase to Kind::Both with host support
  4. Add view.functions traversal to next_context_merging phase
  5. Remove incorrect @default reorder in @switch ingest (preserve source order)
  6. Emit null arg for unresolved target slots in defer reify (viewport,
    interaction, hover triggers)
  7. Add debug_assert for unexpected multi-line arrow functions

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


Note

Medium Risk
Touches multiple compilation phases and changes emitted instruction arguments and validation behavior; while well-scoped with tests/snapshots, it can subtly affect generated output and compatibility across templates/host bindings.

Overview
Improves Angular-compatibility by tightening @switch parsing: non-@case/@default children now error, @case must have exactly one parameter, and @default is limited to one block with no parameters; new tests cover these validations.

Adjusts codegen/IR to better match Angular output: @switch ingestion now explicitly reorders the @default group to the end for consistent slot/function naming, viewport defer triggers now carry options through IR, and defer trigger reify always emits a first argument (slot or null) for viewport/interaction/hover (updating snapshots like ɵɵdeferOnViewport(null)).

Extends pipeline behavior to host compilation and arrow-function internals: generateArrowFunctions now runs for both template and host jobs (new host variant), multi-line template arrow functions are debug-asserted as impossible, and mergeNextContextExpressions now also traverses arrow-function ops lists via view.functions.

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

Copy link
Copy Markdown
Member Author

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

1. Add missing @switch validation: report errors for non-block children,
   enforce exactly one @case parameter, single @default, and no @default
   parameters
2. Carry viewport trigger options through ingest into DeferOnOp IR
3. Change generateArrowFunctions phase to Kind::Both with host support
4. Add view.functions traversal to next_context_merging phase
5. Emit null arg for unresolved target slots in defer reify (viewport,
   interaction, hover triggers)
6. Add debug_assert for unexpected multi-line arrow functions

Item 5 from the review (@switch @default reorder) was verified as a
false positive: Angular does reorder @default last, just not in
ingestSwitchBlock — the generateConditionalExpressions phase splices
@default out as the ternary fallback. The existing Rust reorder is
correct; updated the doc comment to explain why.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the fix/angular-compiler-review-items branch from e424f2b to 84845ee Compare February 22, 2026 02:37
@Brooooooklyn Brooooooklyn merged commit 207654e into main Feb 22, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/angular-compiler-review-items branch February 22, 2026 02:55
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