7 lines
No EOL
454 B
Text
7 lines
No EOL
454 B
Text
==== tests/cases/compiler/returnTypeParameter.ts (2 errors) ====
|
|
function f<T>(a: T): T { } // error, no return statement
|
|
~
|
|
!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
|
function f2<T>(a: T): T { return T; } // bug was that this satisfied the return statement requirement
|
|
~
|
|
!!! Cannot find name 'T'. |