Skip to content

can error message for overload display more information? #26633

@eLeontev

Description

@eLeontev

In Overloads section in https://www.typescriptlang.org/docs/handbook/functions.html mentioned that overload is supported, but that about notification in case if arguments is wrong?

According doc's example we have next error message: "Argument of type 'passedArgumentType' is not assignable to parameter of type 'expectedArgumentType'"
The message will be more informative if whole list of overloads will be displayed.

image

I would expect next message: "Argument of type '""' is not assignable to parameter of list of types 'number' or '{suit: string; card: number; }[]'"

In this case developer can see all list of available types for overloads what will reduce the search of all supported types.

Please let me know is my proposual correct and can it be implemented?

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