You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * @template T * @template {keyof T} K * @typedef Foo */
π Actual behavior
Reports Cannot find name `T`.
π Expected behavior
Does not report an error.
Notes
Name resolution does not look at the symbol table of the @typedef tag, so when looking for T in the code below, we end up looking at T for the function declaration further down in this example:
/** * @template T * @template {keyof T} K * @typedef Foo *//** * @template T * @param {T} a */functionbar(a){}
A "go-to-definition" on the T in keyof T jumps to the T declared for bar, not the T in the typedef for Foo.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
jsdoc name resolve lookup symbol template constraint typedef
π Version & Regression Information
@template
in JSDocβ― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Reports
Cannot find name `T`
.π Expected behavior
Does not report an error.
Notes
Name resolution does not look at the symbol table of the
@typedef
tag, so when looking forT
in the code below, we end up looking atT
for the function declaration further down in this example:A "go-to-definition" on the
T
inkeyof T
jumps to theT
declared forbar
, not theT
in the typedef forFoo
.The text was updated successfully, but these errors were encountered: