TypeScript/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.errors.txt
2014-07-12 17:30:19 -07:00

21 lines
927 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;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! 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;
}