Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sandersn opened this issue Jun 1, 2018 · 0 comments
Closed

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

sandersn opened this issue Jun 1, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript checkJs Relates to checking JavaScript using TypeScript Fixed A PR has been merged for this issue

Comments

@sandersn
Copy link
Member

sandersn commented Jun 1, 2018

(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.

@sandersn sandersn self-assigned this Jun 1, 2018
@mhegazy mhegazy added Bug A bug in TypeScript Salsa checkJs Relates to checking JavaScript using TypeScript labels Jun 4, 2018
@mhegazy mhegazy added this to the TypeScript 3.0 milestone Jun 4, 2018
@sandersn sandersn added the Fixed A PR has been merged for this issue label Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript checkJs Relates to checking JavaScript using TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

2 participants