Fix varargs invocation from luajava #95

Closed
yut23 wants to merge 2 commits from yut23/fix-luajava-varargs into master
yut23 commented 2021-11-12 07:00:03 +00:00 (Migrated from github.com)

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")
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](https://docs.oracle.com/javase/specs/jls/se6/html/expressions.html#45449) of the Java language specs). This allows varargs methods to be called from luajava: ```lua local System = luajava.bindClass("java.lang.System") System.out:printf("%s, %s\n!", "Hello", "world") ```

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-autonomous-connection/luaj#95