2014-07-13 01:04:16 +02:00
|
|
|
//// [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) {
|
2014-08-15 22:18:54 +02:00
|
|
|
} // error, no return statement
|
2014-07-13 01:04:16 +02:00
|
|
|
function f2(a) {
|
|
|
|
return T;
|
2014-08-15 01:36:33 +02:00
|
|
|
} // bug was that this satisfied the return statement requirement
|