TypeScript/tests/baselines/reference/typeArgumentsInFunctionExpressions.types

38 lines
637 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/typeArgumentsInFunctionExpressions.ts ===
var obj = function f<T>(a: T) { // should not error
>obj : <T>(a: T) => T
2014-08-22 03:39:46 +02:00
>function f<T>(a: T) { // should not error var x: T; return a;} : <T>(a: T) => T
>f : <T>(a: T) => T
>T : T
>a : T
>T : T
2014-08-15 23:33:16 +02:00
var x: T;
>x : T
>T : T
2014-08-15 23:33:16 +02:00
return a;
>a : T
2014-08-15 23:33:16 +02:00
};
var obj2 = function f<T>(a: T): T { // should not error
>obj2 : <T>(a: T) => T
2014-08-22 03:39:46 +02:00
>function f<T>(a: T): T { // should not error var x: T; return a;} : <T>(a: T) => T
>f : <T>(a: T) => T
>T : T
>a : T
>T : T
>T : T
2014-08-15 23:33:16 +02:00
var x: T;
>x : T
>T : T
2014-08-15 23:33:16 +02:00
return a;
>a : T
2014-08-15 23:33:16 +02:00
};