19 lines
673 B
Plaintext
19 lines
673 B
Plaintext
tests/cases/compiler/overloadOnConstConstraintChecks4.ts(9,1): 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;
|
|
}
|
|
|