Skip to content

All uses of @typedef-defined types are marked deprecated #39466

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 Jul 7, 2020 · 0 comments · Fixed by #39468
Closed

All uses of @typedef-defined types are marked deprecated #39466

sandersn opened this issue Jul 7, 2020 · 0 comments · Fixed by #39468
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@sandersn
Copy link
Member

sandersn commented Jul 7, 2020

TypeScript Version: latest

/** @typedef {{ email: string, nickName?: string }} U2 */

/** @type {U2} */
const u2 = { email: "" }

Actual behavior:
U2 in /** @type {U2} */ is marked deprecated.

While I dislike @typedef as much as the next programmer, we shouldn't mark every alias created with it as deprecated.

@sandersn sandersn self-assigned this Jul 7, 2020
@sandersn sandersn added this to the Typescript 4.0.1 milestone Jul 7, 2020
sandersn added a commit that referenced this issue Jul 7, 2020
This is only important right now for marking uses of deprecated tags due
to the way that deprecated type references are computed. But I'm
surprised it hasn't caused problems elsewhere.

Fixes #39466
@sandersn sandersn added Bug A bug in TypeScript Fix Available A PR has been opened for this issue labels Jul 7, 2020
sandersn added a commit that referenced this issue Jul 7, 2020
* Mark @typedef as a type declaration

This is only important right now for marking uses of deprecated tags due
to the way that deprecated type references are computed. But I'm
surprised it hasn't caused problems elsewhere.

Fixes #39466

* Also mark @callback and @enum

Requires making name lookup in isTypeDeclarationName smarter, but this
is only used by services, so shouldn't be too performance sensitive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant