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
|
2014-07-25 02:00:03 +02:00
|
|
|
~
|
2014-07-25 04:39:50 +02:00
|
|
|
!!! Argument of type 'number' is not assignable to parameter of type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
x.b<string>(); // error
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
!!! Supplied parameters do not match any signature of call target.
|