a515b199b7
Fixes #93. This is an evolution of #220.
20 lines
No EOL
759 B
Text
20 lines
No EOL
759 B
Text
==== 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;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! Specialized overload signature is not assignable to any non-specialized signature.
|
|
function foo(name: "DIV"): Derived2 {
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
return null;
|
|
~~~~~~~~~~~~~~~~
|
|
}
|
|
~
|
|
!!! A signature with an implementation cannot use a string literal type.
|
|
|
|
foo("HI");
|
|
~~~~
|
|
!!! Argument type 'string' is not assignable to parameter type '"SPAN"'. |