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

15 lines
860 B
Plaintext
Raw Normal View History

tests/cases/compiler/typeAssertionToGenericFunctionType.ts(5,13): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
tests/cases/compiler/typeAssertionToGenericFunctionType.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/typeAssertionToGenericFunctionType.ts (2 errors) ====
var x = {
a: < <T>(x: T) => T > ((x: any) => 1),
b: <T>(x: T) => { x }
}
x.a<string>(1); // bug was that this caused 'Could not find symbol T' on return type T in the type assertion on x.a's definition
~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
2014-07-13 01:04:16 +02:00
x.b<string>(); // error
~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.