langtools/test/tools/javac/meth/VarargsWarn.java
author hannesw
Tue, 22 Mar 2016 14:23:16 +0100
changeset 36690 06b714373aa4
parent 18917 33c954cf3825
permissions -rw-r--r--
8151810: for-in iteration does not provide per-iteration scope Reviewed-by: attila, lagergren

/*
 * @test /nodynamiccopyright/
 * @bug 8019340
 * @summary varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
 *
 * @compile/fail/ref=VarargsWarn.out -XDrawDiagnostics -Werror VarargsWarn.java
 */

import java.lang.invoke.*;

class VarargsWarn {
    void test(MethodHandle mh) throws Throwable {
        mh.invokeExact((Integer[])null);
        mh.invoke((Integer[])null);
        mh.invokeWithArguments((Integer[])null); //not a sig poly method - warning here!
    }
}