Nashorn bug when calling overloaded method with varargs parameter

前端 未结 3 1214
借酒劲吻你
借酒劲吻你 2020-12-15 19:27

Assume the following API:

package nashorn.test;

public class API {

    public static void test(String string) {
        throw new RuntimeException(\"Don\'t         


        
3条回答
  •  孤城傲影
    2020-12-15 20:13

    This is an ambiguous situation. The second case it is looking for either an array of integers or more than one integer to discern from the first case. You can use method selection to tell Nashorn which case you mean.

    API["test(java.lang.Integer[])"](1);
    

提交回复
热议问题