When trying to compile:
function foo(f: (number, number)=>boolean) {}
I get the error:
Duplicate identifier 'number'.
Why? What I'm intending to state is that f is a function that takes two arguments, each of type number, and returns a boolean. How do I state that?
For reference, the following do compile:
function foo2(f: (number) => boolean) { }
function foo3(f: (a: number, b: number) => boolean) { }
function foo4(f: (number, string) => boolean) { }
But the following does not (it generates exactly the same error, Duplicate identifier 'number'):
function foo5(f: (number, number[]) => boolean) { }