-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFixedA PR has been merged for this issueA PR has been merged for this issuecheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript
Milestone
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.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFixedA PR has been merged for this issueA PR has been merged for this issuecheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript