14 lines
257 B
Text
14 lines
257 B
Text
=== tests/cases/compiler/genericFunctions1.ts ===
|
|
function foo<T > (x: T) { return x; }
|
|
>foo : <T>(x: T) => T
|
|
>T : T
|
|
>x : T
|
|
>T : T
|
|
>x : T
|
|
|
|
var x = foo(5); // 'x' should be number
|
|
>x : number
|
|
>foo(5) : number
|
|
>foo : <T>(x: T) => T
|
|
>5 : number
|
|
|