Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

statement in @if behind as not marked as error by compiler #59939

Copy link
Copy link
@sod

Description

@sod
Issue body actions

I had the pleasure to code review this today:

    <!-- part of a component template: -->
    @if (foo; as var && !bar) {
      if is true
    }

This was a result of copy/pasta and trying to modify it. The suspect thought, that !bar was part of the condition and didn't notice the as var in between.

Expected:

  • angular compiler error: var && !bar invalid after as
  • angular warning: var unused

Actual:

  • no warnings at all

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/bolt-angular-pwljvmk3?file=src%2Fmain.ts

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerbugcompiler: parsercore: control flowIssues related to the built-in control flow (@if, @for, @switch)Issues related to the built-in control flow (@if, @for, @switch)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.