37 lines
637 B
Text
37 lines
637 B
Text
=== tests/cases/compiler/typeArgumentsInFunctionExpressions.ts ===
|
|
var obj = function f<T>(a: T) { // should not error
|
|
>obj : <T>(a: T) => T
|
|
>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
|
|
|
|
var x: T;
|
|
>x : T
|
|
>T : T
|
|
|
|
return a;
|
|
>a : T
|
|
|
|
};
|
|
|
|
var obj2 = function f<T>(a: T): T { // should not error
|
|
>obj2 : <T>(a: T) => T
|
|
>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
|
|
|
|
var x: T;
|
|
>x : T
|
|
>T : T
|
|
|
|
return a;
|
|
>a : T
|
|
|
|
};
|
|
|
|
|