luaj icon indicating copy to clipboard operation
luaj copied to clipboard

Fix varargs invocation from luajava

Open yut23 opened this issue 2 years ago • 0 comments

The arguments for a varargs method/constructor should be the fixed arguments, followed by an array of the variable arguments, rather than a flat array of all the arguments (see §15.12.4.2 of the Java language specs).

This allows varargs methods to be called from luajava:

local System = luajava.bindClass("java.lang.System")
System.out:printf("%s, %s\n!", "Hello", "world")

yut23 avatar Nov 12 '21 07:11 yut23