Skip to content

Regression, TS2304: @template-tag no longer works with @type-tag in JSDoc #63982

Description

🔎 Search Terms

"TS2304", "Cannot find name 'T'."

🕗 Version & Regression Information

  • This changed between versions 6.0.3 and 7.0.2
  • This changed in commit or PR ??, could not get every-ts to work
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about generic types
  • I was unable to test this on prior versions because I wasn't sure what to test on prior versions

⏯ Playground Link

https://www.typescriptlang.org/play/?filetype=js#code/PQKhCgAIUgBAXApgWwA4BsCGTIBUowICeqikA3gBQBuAXHgJSQC8AfHgL4HDgDGA9gDsAzvEgBLACYtINTOgCuiJm0jV5SgNxA

💻 Code

/**
 * @template T
 * @type {(v: T) => T}
 */
const id = (value) => value;

🙁 Actual behavior

On TypeScript 7.0, I get the error TS2304: Cannot find name 'T'.

🙂 Expected behavior

@template-tag should work as expected

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions