I have a function with a following signature:
public function on<T>(?onEvent:js.html.Event->Void, ?onCustom:T->Void, ?onVoid:Void->Void){}
Passing Event works as expected (1st argument), passing anything else works as expected (2nd argument) and passing an empty listener also works (3rd argument).
BUT passing js.html.MouseEvent, js.html.TouchEvent does not work, even though they exetend js.html.Event - they are caught by the 2nd argument, where I would like them to be in the 1st one.
I can't detect event type from onCustom since T type is removed at compilation.
Is this behaviour normal, or a bug? Any workarounds?