Files
tsgo/testdata/baselines/reference/submodule/compiler/constantOverloadFunction.errors.txt

19 lines
663 B
Plaintext

constantOverloadFunction.ts(11,5): error TS2322: Type 'null' is not assignable to type 'Base'.
==== constantOverloadFunction.ts (1 errors) ====
class Base { foo() { } }
class Derived1 extends Base { bar() { } }
class Derived2 extends Base { baz() { } }
class Derived3 extends Base { biz() { } }
function foo(tagName: 'canvas'): Derived1;
function foo(tagName: 'div'): Derived2;
function foo(tagName: 'span'): Derived3;
function foo(tagName: string): Base;
function foo(tagName: any): Base {
return null;
~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'Base'.
}