jdk-24/langtools/test/tools/javac/meth/VarargsWarn.java
Maurizio Cimadamore 717a989214 8019340: varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
Disable certain varargs warnings when compiling polymorphic signature calls

Reviewed-by: jjg
2013-07-17 14:19:25 +01:00

18 lines
528 B
Java

/*
* @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!
}
}