Unfortunately, I am facing an issue with Typescript 4.5.4 where the following overload with different tuples of varying lengths does not seem to work for me:
export function f<T1> (t: [T1]) : any { ... }
export function f<T1,T2> (t: [T1,T2]): any { ... }
When trying to use it in another file, like this:
f(["hello"])
f(["hello", "world"])
I receive the following error message from Typescript:
TS2323: Cannot redeclare exported variable 'f'.
Do you have any suggestions for a workaround without having to introduce multiple function names at the top level?
This question is somewhat similar, but the provided answer no longer seems to be effective (EDIT: it works, I misused) and may not address my specific situation (where Tuple type is involved, possibly affecting the solution).