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]
|
2015-02-07 05:03:24 +01:00
|
|
|
function foo(x) { return x; }
|
2014-08-15 23:32:08 +02:00
|
|
|
var x = foo(5); // 'x' should be number
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
//// [genericFunctions0.d.ts]
|
2014-07-12 01:36:06 +02:00
|
|
|
declare function foo<T>(x: T): T;
|
|
|
|
declare var x: number;
|