test/tools/javac/varargs/6313164/T6313164.java

Mon, 17 Oct 2011 12:54:33 +0100

author
mcimadamore
date
Mon, 17 Oct 2011 12:54:33 +0100
changeset 1108
b5d0b8effc85
parent 0
959103a6100f
child 2531
fc2a01ba3d79
permissions
-rw-r--r--

7097436: Project Coin: duplicate varargs warnings on method annotated with @SafeVarargs
Summary: Duplicate aliasing check during subtyping leads to spurious varargs diagnostic
Reviewed-by: jjg

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug     6313164
     4  * @author mcimadamore
     5  * @summary  javac generates code that fails byte code verification for the varargs feature
     6  * @compile/fail/ref=T6313164.out -XDrawDiagnostics T6313164.java
     7  */
     8 import p1.*;
    10 class T6313164 {
    11     { B b = new B();
    12       b.foo1(new B(), new B()); //error - A not accesible
    13       b.foo2(new B(), new B()); //ok - A not accessible, but foo2(Object...) applicable
    14       b.foo3(null, null); //error - A (inferred) not accesible
    15       b.foo4(null, null); //error - A (inferred in 15.12.2.8 - no resolution backtrack) not accesible
    16       b.foo4(new B(), new C()); //ok - A (inferred in 15.12.2.7) not accessible, but foo4(Object...) applicable
    17     }
    18 }

mercurial