Can you provide an explanation for the error in bar1
but not in bar2
? What are the fundamental differences between them?
const foo1 = <E extends (a: unknown)=>void>(e:E)=>console.log(e)
const bar1 = <Arg extends unknown>()=>foo1((a:Arg)=>console.log(a))
const foo2 = <Arg extends unknown>(e:(a: Arg)=>void)=>console.log(e)
const bar2 = <Arg extends unknown>()=>foo2((a:Arg)=>console.log(a))