Skip to content

Improve @overload error message to mention name of host function #1042

Description

@sandersn
/**
 * @overload
 * @param {number} x
 */

/**
 * @overload
 * @param {string} x
 */

/**
 * @param {string | number} x
 * @returns {string | number}
 */
function id(x) {
    return x;
}

Expected:
This overload of 'id' lacks a return-type annotation and implicitly has an 'any' return type.

Actual:
This overload implicitly returns the type 'any' because it lacks a return type annotation.

Compare to the message for TS overloads:
'id', which lacks return-type annotation, implicitly has an 'any' return type.

Blocked on being able change errors in Go; right now they are generated from the Typescript submodule.

Metadata

Metadata

Labels

Domain: JSRelated to JS parsing, checking

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions