Skip to content
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

values are marked deprecated when only type has @deprecated #39474

Closed
rbuckton opened this issue Jul 7, 2020 · 2 comments
Closed

values are marked deprecated when only type has @deprecated #39474

rbuckton opened this issue Jul 7, 2020 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this

Comments

@rbuckton
Copy link
Member

rbuckton commented Jul 7, 2020

TypeScript Version: 4.0.0-dev.20200701

Search Terms: jsdoc deprecated tag

Code

interface ESMap<K, V> { }

/** @deprecated */
interface Map<T> extends ESMap<string, T> {}

declare const Map: new <K, V>() => ESMap<K, V>;

new Map<string, number>(); // 'Map' is crossed out

Expected behavior:

  • Map the value is not deprecated and should not be crossed out.

Actual behavior:

  • Map the value is considered deprecated, even though Map the type is not part of the value declaration of Map:

In VSCode:
image

In Playground:
image

Playground Link: https://www.typescriptlang.org/play/index.html?ts=4.0.0-dev.20200707#code/KYDwDg9gTgLgBAbzgXwNwCh0EsB2NhQBmAhgMbBwCiAygLLFgA8A0gDRwBqAfIipgPQAqQXAACAE2BgowUsXzi4g-tjwES5OPSYAVHqHw5xAZyp0GjYzCi4A5uz2JkmSaQA2xGXFIQcVrQwAXHA4wADucCzs3AAUAJRwALw8NNpRnFwYmOihEWlWNjj2IQCuALYARgRc8ahw-PxwAOTaTXBYpj5+WJIyipLSsvLAijHGwBQAjiVYpADW7TiEEHFAA

Related Issues: #38523

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation labels Jul 8, 2020
@DanielRosenwasser DanielRosenwasser added this to the Typescript 4.0.1 milestone Jul 8, 2020
@DanielRosenwasser DanielRosenwasser added Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this labels Jul 8, 2020
@DanielRosenwasser
Copy link
Member

Probably look into getSemanticMeaning, then add some special cases. See if that is useful.

@sandersn sandersn changed the title jsdoc deprecated tag is too aggressive value are marked deprecated when only type has @deprecated Jul 8, 2020
@sandersn sandersn changed the title value are marked deprecated when only type has @deprecated values are marked deprecated when only type has @deprecated Jul 8, 2020
@sandersn
Copy link
Member

sandersn commented Jul 9, 2020

Fixed by #39323

@sandersn sandersn closed this as completed Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation Effort: Moderate Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual". Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants