TypeScript/tests/baselines/reference/genericFunctions0.js

16 lines
282 B
JavaScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [genericFunctions0.ts]
function foo<T > (x: T) { return x; }
var x = foo<number>(5); // 'x' should be number
//// [genericFunctions0.js]
function foo(x) {
return x;
}
var x = foo(5);
//// [genericFunctions0.d.ts]
declare function foo<T>(x);
declare var x;