langtools/test/tools/javac/varargs/6313164/T6313164.java
author mcimadamore
Fri, 28 Jan 2011 12:03:49 +0000
changeset 8229 39266c1b1b0e
child 25008 969bfaae5bce
permissions -rw-r--r--
6313164: javac generates code that fails byte code verification for the varargs feature Summary: method applicability check should fail if formal varargs element type is not accessible Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug     6313164
 * @author mcimadamore
 * @summary  javac generates code that fails byte code verification for the varargs feature
 * @compile/fail/ref=T6313164.out -XDrawDiagnostics T6313164.java
 */
import p1.*;

class T6313164 {
    { B b = new B();
      b.foo1(new B(), new B()); //error - A not accesible
      b.foo2(new B(), new B()); //ok - A not accessible, but foo2(Object...) applicable
      b.foo3(null, null); //error - A (inferred) not accesible
      b.foo4(null, null); //error - A (inferred in 15.12.2.8 - no resolution backtrack) not accesible
      b.foo4(new B(), new C()); //ok - A (inferred in 15.12.2.7) not accessible, but foo4(Object...) applicable
    }
}