Skip to content

fix(angular): use fail-fast error handling for invariant violations and remove panics#37

Merged
Brooooooklyn merged 1 commit intomainfrom
fix/angular-fail-fast-error-handling
Feb 25, 2026
Merged

fix(angular): use fail-fast error handling for invariant violations and remove panics#37
Brooooooklyn merged 1 commit intomainfrom
fix/angular-fail-fast-error-handling

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Feb 24, 2026

  • Make i18n metadata type checks fail-fast (return early) instead of
    silently dropping placeholders, matching Angular's throw behavior
  • Make unknown @for loop variable checks fail-fast instead of emitting
    empty expressions, matching Angular's AssertionError throw
  • Add 4 unit tests for the fail-fast behavior
  • Replace all panic!/unreachable!/debug_assert! in production code with
    diagnostics-style error reporting or safe fallbacks (10 instances)

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


Note

Medium Risk
Touches core compiler ingestion/optimization paths and changes error-handling semantics to early-return with diagnostics, which can alter emitted IR/output on previously tolerated invalid states.

Overview
Aligns Angular template ingestion with Angular’s fail-fast behavior by treating unexpected i18n metadata and unknown @for loop variables as hard errors: convert_i18n_meta_to_placeholder/get_computed_for_loop_variable_expression now return Result, callers early-return to avoid emitting broken IR, and new unit tests cover these cases.

Across several pipeline/output phases, replaces panic!/unreachable!/debug_assert!-guarded invariants with diagnostics plus safe fallbacks (e.g., cloning WrappedIrNodeundefined, skipping multi-line arrow function conversion, handling short safe-ternary chains, reporting unexpected UpdateOp variants, and graceful CSS quote handling).

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

Copy link
Member Author

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

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

…nd remove panics

- Make i18n metadata type checks fail-fast (return early) instead of
  silently dropping placeholders, matching Angular's throw behavior
- Make unknown @for loop variable checks fail-fast instead of emitting
  empty expressions, matching Angular's AssertionError throw
- Add 4 unit tests for the fail-fast behavior
- Replace all panic!/unreachable!/debug_assert! in production code with
  diagnostics-style error reporting or safe fallbacks (10 instances)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the fix/angular-fail-fast-error-handling branch from f4b09d5 to d8306dd Compare February 24, 2026 13:49
@Brooooooklyn Brooooooklyn merged commit 8435daf into main Feb 25, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/angular-fail-fast-error-handling branch February 25, 2026 02:46
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