test/tools/javac/generics/6711619/T6711619b.java

Thu, 06 Jun 2013 15:33:40 +0100

author
mcimadamore
date
Thu, 06 Jun 2013 15:33:40 +0100
changeset 1811
349160289ba2
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8008627: Compiler mishandles three-way return-type-substitutability
Summary: Compiler should not enforce an order in how ambiguous methods should be resolved
Reviewed-by: jjg, vromero

mcimadamore@155 1 /*
jjg@384 2 * @test /nodynamiccopyright/
mcimadamore@155 3 * @bug 6711619
mcimadamore@155 4 *
mcimadamore@155 5 * @summary javac doesn't allow access to protected members in intersection types
mcimadamore@155 6 * @author Maurizio Cimadamore
mcimadamore@155 7 *
mcimadamore@155 8 * @compile/fail/ref=T6711619b.out -XDrawDiagnostics T6711619b.java
mcimadamore@155 9 */
mcimadamore@155 10
mcimadamore@155 11 class T6711619b {
mcimadamore@155 12 static class X1<E extends X1<E>> {
mcimadamore@155 13 private int i;
mcimadamore@155 14 E e;
mcimadamore@155 15 int f() {
mcimadamore@155 16 return e.i;
mcimadamore@155 17 }
mcimadamore@155 18 }
mcimadamore@155 19
mcimadamore@155 20 static class X2<E extends X2<E>> {
mcimadamore@155 21 static private int i;
mcimadamore@155 22 int f() {
mcimadamore@155 23 return E.i;
mcimadamore@155 24 }
mcimadamore@155 25 }
mcimadamore@155 26
mcimadamore@155 27 static class X3<E extends X3<E> & java.io.Serializable> {
mcimadamore@155 28 private int i;
mcimadamore@155 29 E e;
mcimadamore@155 30 int f() {
mcimadamore@155 31 return e.i;
mcimadamore@155 32 }
mcimadamore@155 33 }
mcimadamore@155 34
mcimadamore@155 35 static class X4<E extends X4<E> & java.io.Serializable> {
mcimadamore@155 36 static private int i;
mcimadamore@155 37 int f() {
mcimadamore@155 38 return E.i;
mcimadamore@155 39 }
mcimadamore@155 40 }
jjg@384 41 }

mercurial