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

Thu, 27 Aug 2009 11:08:27 -0700

author
jjg
date
Thu, 27 Aug 2009 11:08:27 -0700
changeset 384
ed31953ca025
parent 155
4d2d8b6459e1
child 2525
2eb010b6cb22
permissions
-rw-r--r--

6875336: some tests should use /nodynamiccopyright/
Reviewed-by: darcy

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

mercurial