beanshell / beanshell

Beanshell scripting language
Apache License 2.0
815 stars 183 forks source link

support varargs simple function #761

Closed geovanny1781 closed 1 month ago

geovanny1781 commented 2 months ago

Support varargs?, I try this simple function: interpreter.eval("int sumTwoNum(int... numeros) { return 1;}"); and error: bsh.ParseException: Parse error at line 1, column 18. Encountered: int

nickl- commented 1 month ago

Seems to work for me, please ensure that you are using BeanShell 3.0.0-SNAPSHOT

BeanShell 3.0.0-SNAPSHOT.5569
bsh % int sumTwoNum(int... numeros) { return 1;}
--> void
bsh % sumTwoNum(1,2,3,4);
--> $0 = 1I :int

Closed cannot reproduce.