Apparently we can't infer the return type of a generic function based on a generic input. One of the guys in the gitter TypeScript channel gave me this example explanation.
^ example however does not actually work how it's explained...
functionidentity<T>(a:T):Promise<T>{returnPromise.resolve(a);}interfaceCallable<ReturnType>{(...args:any[]):ReturnType;}typeGenericReturnType<ReturnType,F>=FextendsCallable<ReturnType>?ReturnType:never;typeIdentityType=GenericReturnType<string,typeofidentity>;// never
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Apparently we can't infer the return type of a generic function based on a generic input. One of the guys in the gitter TypeScript channel gave me this example explanation.
^ example however does not actually work how it's explained...