25 lines
1.3 KiB
Plaintext
25 lines
1.3 KiB
Plaintext
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(6,1): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
|
|
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(7,1): error TS2381: A signature with an implementation cannot use a string literal type.
|
|
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345: Argument of type 'string' is not assignable to parameter of type '"SPAN"'.
|
|
|
|
|
|
==== tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts (3 errors) ====
|
|
class Base { foo() { } }
|
|
class Derived1 extends Base { bar() { } }
|
|
class Derived2 extends Base { baz() { } }
|
|
class Derived3 extends Base { biz() { } }
|
|
|
|
function foo(name: "SPAN"): Derived1;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
|
|
function foo(name: "DIV"): Derived2 {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
return null;
|
|
~~~~~~~~~~~~~~~~
|
|
}
|
|
~
|
|
!!! error TS2381: A signature with an implementation cannot use a string literal type.
|
|
|
|
foo("HI");
|
|
~~~~
|
|
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type '"SPAN"'. |