Skip to content

language-service: show warning if component variable is shadowed by template reference #15956

@kemsky

Description

@kemsky

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
See example, variable name is silently shadowed:

class Comopnent {
     public name:string;
}

<div #name="ngName">
</div>

Expected behavior
Warning or error.

What is the motivation / use case for changing the behavior?
Shadowing is usually not desired and indicates mistake.

  • Angular version: 4.0.2

  • Browser: [all]

  • Language: [TypeScript 2.1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: language-serviceIssues related to Angular's VS Code language servicefeatureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions