Closed
Description
TypeScript Version: 2.3.2, 2.4.1
Update: verified in 2.4.1, still not working
Code
declare function f<T>(obj: { [K in keyof T]: (arg: number) => T[K]; }): T;
const r = f({ a: x => x, b: y => 10 });
Expected behavior:
Type of r
is { a: number, b: number}
Type of both x
and y
is number
Actual behavior:
Type of r
is { a:
number
any
, b: number}
Type of both x
and y
is number
any