-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
False positive reported for static methods with a type parameter with the same name as the containing class' type parameter.
export class Wrapper<Wrapped> {
private constructor(private readonly wrapped: Wrapped) {}
unwrap(): Wrapped {
return this.wrapped;
}
static create<Wrapped>(wrapped: Wrapped) {
return new Wrapper<Wrapped>(wrapped);
}
}
In a static method, the type parameters for the class are not in scope because there's no instance.
moltar, InExtremaRes, sehilyi, yannickglt and yrtimiD
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin