Closed
Description
Typedef tags are supposed to be visible in the parent scope of the jsdoc comment they are attached to. That also means that they should not be able to see things in the same jsdoc comment that are supposed to be visible in the child scope, such as @template
.
/**
* @template T
* @typedef {T} N
*/
class C {
/** @param {N} n */
m(n) {
n
}
}
/** @type {N} */
var y;
Expected behavior:
n: T
and y: unknown
with an error on @type {N}
"Cannot resolve name 'N'."
Actual behavior:
n: T
and y: T
and no error.