8000 Rule Propsal: No generic type variable shadowing · Issue #521 · typescript-eslint/typescript-eslint · GitHub {"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rule Propsal: No generic type variable shadowing","articleBody":"Example code:\r\n\r\n```ts\r\nclass Foo\u003cT\u003e {\r\n bar\u003cT\u003e() {\r\n // here, T refers to the T for bar, not the T for Foo\r\n }\r\n}\r\n```\r\n\r\nA rule could ban instances where a generic type variable is introduced with the same name as one in the enclosing scope. Related to https://github.com/typescript-eslint/typescript-eslint/issues/54","author":{"url":"https://github.com/nmain","@type":"Person","name":"nmain"},"datePublished":"2019-05-13T15:08:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/521/typescript-eslint/issues/521"}
[go: up one dir, main page]

Skip to content

Rule Propsal: No generic type variable shadowing #521

@nmain

Description

@nmain

Example code:

class Foo<T> {
    bar<T>() {
        // here, T refers to the T for bar, not the T for Foo
    }
}

A rule could ban instances where a generic type variable is introduced with the same name as one in the enclosing scope. Related to #54

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0