21 lines
No EOL
927 B
Text
21 lines
No EOL
927 B
Text
==== tests/cases/compiler/constantOverloadFunctionNoSubtypeError.ts (3 errors) ====
|
|
class Base { foo() { } }
|
|
class Derived1 extends Base { bar() { } }
|
|
class Derived2 extends Base { baz() { } }
|
|
class Derived3 extends Base { biz() { } }
|
|
|
|
function foo(tagName: 'canvas'): Derived3;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! Specialized overload signature is not assignable to any non-specialized signature.
|
|
function foo(tagName: 'div'): Derived2;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! Specialized overload signature is not assignable to any non-specialized signature.
|
|
function foo(tagName: 'span'): Derived1;
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! Specialized overload signature is not assignable to any non-specialized signature.
|
|
function foo(tagName: number): Base;
|
|
function foo(tagName: any): Base {
|
|
|
|
return null;
|
|
}
|
|
|