8000 @let pollutes component scope · Issue #58242 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content
8000

@let pollutes component scope #58242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
austinw-fineart opened this issue Oct 17, 2024 · 2 comments
Closed

@let pollutes component scope #58242

austinw-fineart opened this issue Oct 17, 2024 · 2 comments

Comments

@austinw-fineart
Copy link

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

No

Description

Given the component:

@Component({
  selector: 'app-root',
  standalone: true,
  template: `
    @let i = 0;
    {{ this.i }}
  `,
})
export class App {
  protected i = 1;
}

What I expected: 1
What I got instead: 0
Given the warning below, it seems even the compiler is confused.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-pesdcd?file=src%2Fmain.ts

Please provide the exception or error you saw

▲ [WARNING] NG8112: @let i is declared but its value is never read. [plugin angular-compiler]

src/main.ts:8:4:
  8 │     @let i = 0;
    ╵     ~~~~~~~~~~

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 18.2.7
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 18.2.7
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package Version

@angular-devkit/architect 0.1802.7
@angular-devkit/build-angular 18.2.7
@angular-devkit/core 18.2.7
@angular-devkit/schematics 18.2.7
@schematics/angular 18.2.7
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.10

Anything else?

No response

@pkozlowski-opensource
Copy link
Member

I believe that it was fixed via #55183 (merged last week, will be part of the v19 release).

@pkozlowski-opensource pkozlowski-opensource closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been 610E performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0