TypeScript Version: 4.0.2
Code
interfaceFoo{bla: string;}declarefunctionmap<T,R>(value: T[],transform: (t: T)=>R): R[];declareconstfoos: Foo[];declarefunctioncall<Fnextends(...args: any[])=>any>(fn: Fn,
...args: Parameters<Fn>): ReturnType<Fn>;consta=call(map,foos,(foo: Foo)=>foo.bla);Expected behavior:
I expect this to give no compile errors.
Actual behavior:
Argument of type '(foo: Foo) => string' is not assignable to parameter of type '(t: unknown) => unknown'. Types of parameters 'foo' and 't' are incompatible. Type 'unknown' is not assignable to type 'Foo'
Playground Link:
Playground
TypeScript Version: 4.0.2
Code
Expected behavior:
I expect this to give no compile errors.
Actual behavior:
Playground Link:
Playground