Instead, you can use function expressions:
const f = function<T1>(arg1: T1) { return function<T2>(arg2: T2) { return { arg1, arg2 }; }; };
Or, alternatively, I found that this works:
const f = <T1, T2>(arg1: T1) => (arg2: T2) => { return { arg1, arg2 }; };
Regarding sidenote, it seems that it will compile normally when several common parameters are provided, but not one. For example, providing a dummy shared parameter will do the job:
const f = <T1, _>(arg1: T1) => { return { arg1 }; };
It is definitely not perfect, though. There may be another way to get this to work with only one common parameter, but I'm not sure.
source share