Skip to content

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

Closed

Description

@rbuckton

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

Activity

  1. DanielRosenwasser commented on Jul 8, 2020

    @DanielRosenwasser
    Member

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

  2. changed the title [-]jsdoc deprecated tag is too aggressive[/-] [+]value are marked deprecated when only type has @deprecated[/+] on Jul 8, 2020
  3. changed the title [-]value are marked deprecated when only type has @deprecated[/-] [+]values are marked deprecated when only type has @deprecated[/+] on Jul 8, 2020
  4. sandersn commented on Jul 9, 2020

    @sandersn
    Member

    Fixed by #39323

  5. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do this

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions