-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Good issue if you're already used to contributing to the codebase. Harder than "good first issue".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thischeckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript
Milestone
Description
// @ts-check
/**
* @overload
* @param {number} x
*/
/**
* @overload
* @param {string} x
*/
/**
* @param {string | number} x
* @returns {string | number}
*/
function id(x) {
return x;
}
export let a = id(123);
export let b = id("hello");
Here, the first two signatures of id
are missing an @return
/@returns
tag. That means that they're implicitly any
.
Under noImplicitAny
, this example should issue an error on both @overload
tags saying that they implicitly return the type any
.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Good issue if you're already used to contributing to the codebase. Harder than "good first issue".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thischeckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript