TypeScript/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt
2014-09-11 16:11:08 -07:00

21 lines
969 B
Plaintext

==== 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;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
function foo(tagName: 'div'): Derived2;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
function foo(tagName: 'span'): Derived1;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
function foo(tagName: number): Base;
function foo(tagName: any): Base {
return null;
}