TypeScript/tests/baselines/reference/specializedOverloadWithRestParameters.errors.txt

17 lines
790 B
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/specializedOverloadWithRestParameters.ts (2 errors) ====
class Base { foo() { } }
class Derived1 extends Base { bar() { } }
function f(tagName: 'span', ...args): Derived1; // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Specialized overload signature is not assignable to any non-specialized signature.
function f(tagName: number, ...args): Base;
function f(tagName: any): Base {
return null;
}
function g(tagName: 'span', arg): Derived1; // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Specialized overload signature is not assignable to any non-specialized signature.
function g(tagName: number, arg): Base;
function g(tagName: any): Base {
return null;
}