Skip to content

JSDoc type tags don't check that that type arguments are correct #24592

@sandersn

Description

@sandersn

(Found while fixing #24283)

type A<T extends string> = { a: T }
/** Also fails if template tags allow constraints
 * @template {string} U
 * @typedef {{ b: U }} B
 */
/** @type {A<number>} */
var a;
/** @type {B<number>} */
var b;

Expected behavior:
Error in both type tags: 'number' is not assignable to 'string'

Actual behavior:
No error.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issuecheckJsRelates to checking JavaScript using TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions