Is there a way to fix the following code so that the type of x is number?
type IdentityMap = <K>(arg: K) => K;
type InferredValueType<K, KtoV extends (arg: K) => any> = KtoV extends (
arg: K
) => infer V
? V
: never;
let x: InferredValueType<number, IdentityMap>;
In general, I want to represent a type-level function that maps types K to other types V