• Error
  • Reported by the type checker

TS2394

This overload signature is not compatible with its implementation signature.

An overload signature accepts or returns something its implementation signature does not. Make the implementation cover every overload.

What it means

Every overload has to be compatible with the implementation that follows: the implementation's parameters must accept the overload's arguments, and its return type must fit the overload's return type. It's reported on the first overload that doesn't fit.

Example

index.ts
export function pad(value: string): string;
export function pad(value: number): string;
export function pad(value: string): string {
  return value.padStart(4);
}
ts-r-check -p tsconfig.json --pretty false ts-r output
index.ts(2,17): error TS2394: This overload signature is not compatible with its implementation signature.

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.

How to fix

  • Widen the implementation's parameters to cover every overload (here value: string | number).
  • Remove the overload if the implementation was never meant to handle it.