On Nov 11, 2016, at 7:09 AM, fo...@univ-mlv.fr wrote: > MH.invokeWithArguments takes an array of arguments but because it is > specified as a varargs you may think that it works like Method.invoke, but it > is a trap, > it takes the receiver and the arguments altogether into the same array.
Thanks, Remi. That should fix the problem. We thought a little bit about adding more overloadings to invokeWithArguments, such as one that works like Method.invoke (one prepended argument). The general case would be making invokeWithArguments be signature-polymorphic, with an on-the-fly asSpreader transform on the way through. But, such extra generality would simplify only a few use cases, and on the other hand it would probably create plenty of confusion whenever the target method is *also* a varargs method. — John