Mon, 24 Nov 2014 14:55:38 -0800
8059921: Missing compile error in Java 8 mode for Interface.super.field access
Reviewed-by: mcimadamore, jlahoda
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8019340
4 * @summary varargs-related warnings are meaningless on signature-polymorphic methods such as MethodHandle.invokeExact
5 *
6 * @compile/fail/ref=VarargsWarn.out -XDrawDiagnostics -Werror VarargsWarn.java
7 */
9 import java.lang.invoke.*;
11 class VarargsWarn {
12 void test(MethodHandle mh) throws Throwable {
13 mh.invokeExact((Integer[])null);
14 mh.invoke((Integer[])null);
15 mh.invokeWithArguments((Integer[])null); //not a sig poly method - warning here!
16 }
17 }