Microsoft/TypeScript
GitHub ã§èŠãDiagnostic for incompatible overload signature doesn't explain why
Open
#48,186 opened on 2022幎3æ9æ¥
BugDomain: Error MessagesHelp Wanted
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
Bug Report
ð Search Terms
function incompatible overload implementation signature assignability TS2394
ð Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about function overloads
⯠Playground Link
Playground link with relevant code
ð» Code
function example(overloaded: string): string;
function example(actual: number, option?: boolean): string {
return `${actual}${option}`;
}
ð Actual behavior
A single line of error message that doesn't indicate which parameter or return type is the issue.
function example(overloaded: string): string;
// ~~~~~~~
// Error: This overload signature is not compatible with its implementation signature.
ð Expected behavior
Can we elaborate on that error message with the first assignability issue?
Bikeshedding on the error message specifics welcome...
function example(overloaded: string): string;
// ~~~~~~~
// Error: This overload signature is not compatible with its implementation signature.
// Overload parameter 'overload: string' is not assignable to implementation parameter 'actual: number'.