TypeScript/tests/baselines/reference/overloadOnConstConstraintChecks4.errors.txt

19 lines
656 B
Plaintext

tests/cases/compiler/overloadOnConstConstraintChecks4.ts(9,10): error TS2394: Overload signature is not compatible with function implementation.
==== tests/cases/compiler/overloadOnConstConstraintChecks4.ts (1 errors) ====
class Z { }
class A extends Z { private x = 1 }
class B extends A {}
class C extends A {
public foo() { }
}
function foo(name: 'hi'): B;
function foo(name: 'bye'): C;
function foo(name: string): A; // error
~~~
!!! error TS2394: Overload signature is not compatible with function implementation.
function foo(name: any): Z {
return null;
}