Let's assume a simplified example (i know in this particular simplification the overloading is not needed, but it's simplified)
EDIT: the first example given was not enough to understand the issue, here is an updated one:
function fn <T>( // Overload signature is not compatible with function implementation.ts(2394)
fn: (item: T) => T,
): (idx: number) => (src: T[]) => T[]
function fn <T>(
fn: (item: T) => T,
idx: number,
): (src: T[]) => T[]
function fn(fn: (x: any) => any, idx?: number) {
}
How in this cas would you qualify the Return type in the implementation.
I've got the compiler complaining on the first definition with ts(2394)and i do not get what i'm doing wrong.
Thank you in advance Seb