TypeScript/tests/baselines/reference/genericFunctions1.js
2014-07-15 13:08:10 -07:00

16 lines
288 B
JavaScript

//// [genericFunctions1.ts]
function foo<T > (x: T) { return x; }
var x = foo(5); // 'x' should be number
//// [genericFunctions1.js]
function foo(x) {
return x;
}
var x = foo(5);
//// [genericFunctions1.d.ts]
declare function foo<T>(x: T): T;
declare var x: number;