15 lines
247 B
Plaintext
15 lines
247 B
Plaintext
=== 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) : 5
|
|
>foo : <T>(x: T) => T
|
|
>5 : 5
|
|
|