Can't invoke vararg @FunctionalInterface methods

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • b81
    • generic
    • generic

        Given this test interface:

        package jdk.nashorn.test.models;

        @FunctionalInterface
        public interface VarArgConsumer {
            public void apply(Object... o);
        }

        This won't work:

        var c = new (Java.type("jdk.nashorn.test.models.VarArgConsumer"))(
            function() { print(arguments.length) });
        c(1, 2, 3)

        A solution would be to rely on Dynalink's DynamicMethod instead of reflective Method.

              Assignee:
              Sundararajan Athijegannathan
              Reporter:
              Attila Szegedi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: