mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
14 lines
641 B
Plaintext
14 lines
641 B
Plaintext
compositeGenericFunction.ts(3,44): error TS2322: Type 'null' is not assignable to type 'R'.
|
|
'R' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
|
|
|
|
==== compositeGenericFunction.ts (1 errors) ====
|
|
function f<T>(value: T) { return value; };
|
|
|
|
function h<R>(func: (x: number) => R): R { return null; }
|
|
~~~~~~
|
|
!!! error TS2322: Type 'null' is not assignable to type 'R'.
|
|
!!! error TS2322: 'R' could be instantiated with an arbitrary type which could be unrelated to 'null'.
|
|
|
|
var z: number = h<number>(f);
|
|
var z: number = h(f); |