Skip to content

JSDoc @override on an @overload signature is ignored under noImplicitOverride (TS4119)Β #64524

Description

@jwbth

πŸ”Ž Search Terms

noImplicitOverride, JSDoc @overload, @override, TS4119, checkJs

πŸ•— Version & Regression Information

  • This changed between versions 6.0.3 and 7.0.2 (still present in 7.1.0-dev.20260929.1)

⏯ Playground Link

No response

πŸ’» Code

// jsconfig.json
{
  "compilerOptions": {
    "allowJs": true,
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "noImplicitOverride": true
  },
  "include": ["*.js"]
}
// a.js
class Base {
  /**
   * @param {string} x
   * @returns {string}
   */
  f(x) {
    return x
  }
}

class Derived extends Base {
  /**
   * @override
   * @overload
   * @param {'a'} x
   * @returns {'a'}
   */
  /**
   * @override
   * @param {string} x
   * @returns {string}
   */
  f(x) {
    return x
  }
}

export {}

πŸ™ Actual behavior

a.js(14,7): error TS4119: This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class 'Base'.

πŸ™‚ Expected behavior

No error, as in 6.0.3. The overload signature has an @override tag.

Additional information about the issue

Possibly related: microsoft/typescript-go#4044 (JSDoc @override not mapped to the override modifier in declaration emit; fixed), which suggests the overload path wasn't covered.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions