TypeScript/tests/baselines/reference/returnTypeParameter.js
2014-07-12 17:30:19 -07:00

11 lines
280 B
JavaScript

//// [returnTypeParameter.ts]
function f<T>(a: T): T { } // error, no return statement
function f2<T>(a: T): T { return T; } // bug was that this satisfied the return statement requirement
//// [returnTypeParameter.js]
function f(a) {
}
function f2(a) {
return T;
}