11 lines
761 B
Plaintext
11 lines
761 B
Plaintext
tests/cases/compiler/returnTypeParameter.ts(1,22): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
|
tests/cases/compiler/returnTypeParameter.ts(2,34): error TS2304: Cannot find name 'T'.
|
|
|
|
|
|
==== tests/cases/compiler/returnTypeParameter.ts (2 errors) ====
|
|
function f<T>(a: T): T { } // error, no return statement
|
|
~
|
|
!!! error TS2355: 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
|
|
~
|
|
!!! error TS2304: Cannot find name 'T'. |