TypeScript/tests/baselines/reference/genericFunctions1.js

14 lines
306 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [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); // 'x' should be number
2014-07-13 01:04:16 +02:00
//// [genericFunctions1.d.ts]
2014-07-12 01:36:06 +02:00
declare function foo<T>(x: T): T;
declare var x: number;