TypeScript/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt
2014-09-12 13:35:07 -07:00

35 lines
1.8 KiB
Plaintext

tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(2,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(6,29): error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(17,9): error TS2381: A signature with an implementation cannot use a string literal type.
tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(18,9): error TS2381: A signature with an implementation cannot use a string literal type.
==== tests/cases/compiler/overloadOnConstNoStringImplementation2.ts (4 errors) ====
interface I {
x1(a: number, callback: (x: 'hi') => number);
~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
}
class C implements I {
x1(a: number, callback: (x: 'hi') => number);
~~~~~~~~~~~~~~~~~~~
!!! error TS2382: Specialized overload signature is not assignable to any non-specialized signature.
x1(a: number, callback: (x: any) => number) {
callback('hi');
callback('bye');
var hm = "hm";
callback(hm);
callback(1);
}
}
var c: C;
c.x1(1, (x: 'hi') => { return 1; } );
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2381: A signature with an implementation cannot use a string literal type.
c.x1(1, (x: 'bye') => { return 1; } );
~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2381: A signature with an implementation cannot use a string literal type.
c.x1(1, (x: string) => { return 1; } );
c.x1(1, (x: number) => { return 1; } );