TypeScript inference not working on nested generics, infers type as unknown

I need TypeScript to correctly infer the type T in the return value of my "wrongInference" function. interface Foo { bar: string; } const paramFunction = (bar: string): Foo => ({ bar }); type GenericFunction<T> = (…args: any) => T; export const wrongInference = <T, F extends GenericFunction<T>>( paramFunction: F ) => ({ data: {}… Read More TypeScript inference not working on nested generics, infers type as unknown