-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
π Search Terms
ts2302 jsdoc
π Version & Regression Information
- This changed between versions
4.4.4and4.5.4
β― Playground Link
Playground link with relevant code
π» Code
/**
* @template T1
* @typedef {T1} TakesT1
*/
/**
* @template T1
* @template T2
*/
class Foo {
/**
* @template T1
* @template {TakesT1<T1>} T2
* ^^--- Static members cannot reference
* class type parameters.(2302)
* @param {T1} t1
* @param {T2} t2
*/
static bar(t1, t2) {
}
}π Actual behavior
"Static members cannot reference class type parameters." This is wrong because the equivalent typescript for this situation does not give an error: playground.
π Expected behavior
No ts2302 error, TakesT1<T1> should use the T1 generic from the static bar() method, rather than from the Foo class.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationHelp WantedYou can do thisYou can do this