TypeScript/tests/baselines/reference/overloadOnConstNoAnyImplementation.errors.txt
2014-07-24 19:39:50 -07:00

24 lines
992 B
Plaintext

==== tests/cases/compiler/overloadOnConstNoAnyImplementation.ts (4 errors) ====
function x1(a: number, cb: (x: 'hi') => number);
~~~~~~~~~~~~~~~~~~~
!!! Specialized overload signature is not assignable to any non-specialized signature.
function x1(a: number, cb: (x: 'bye') => number);
~~~~~~~~~~~~~~~~~~~~
!!! Specialized overload signature is not assignable to any non-specialized signature.
function x1(a: number, cb: (x: string) => number) {
cb('hi');
cb('bye');
var hm = 'hm';
cb(hm);
cb('uh');
cb(1); // error
~
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
}
var cb: (number) => number = (x: number) => 1;
x1(1, cb);
x1(1, (x: 'hi') => 1); // error
~~~~~~~~~~~~~~
!!! A signature with an implementation cannot use a string literal type.
x1(1, (x: string) => 1);