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