154:6508d7e812e1 | 155:4d2d8b6459e1 |
---|---|
21 * have any questions. | 21 * have any questions. |
22 */ | 22 */ |
23 | 23 |
24 /* | 24 /* |
25 * @test | 25 * @test |
26 * @bug 6531090 | 26 * @bug 6531090 6711619 |
27 * | 27 * |
28 * @summary Cannot access methods/fields of a captured type belonging to an intersection type | 28 * @summary Cannot access methods/fields of a captured type belonging to an intersection type |
29 * @author Maurizio Cimadamore | 29 * @author Maurizio Cimadamore |
30 * | 30 * |
31 */ | 31 */ |
32 public class T6531090b { | 32 public class T6531090b { |
33 | 33 |
34 static class A { | 34 static class A { |
35 public void a() {} | 35 public void a1() {} |
36 public A a; | 36 protected void a2() {} |
37 void a3() {} | |
38 public A a1; | |
39 protected A a2; | |
40 A a3; | |
37 } | 41 } |
38 static class B extends A { | 42 static class B extends A { |
39 public void b(){} | 43 public void b1() {} |
40 public B b; | 44 protected void b2() {} |
45 void b3() {} | |
46 public B b1; | |
47 protected B b2; | |
48 B b3; | |
41 } | 49 } |
42 static interface I{ | 50 static interface I{ |
43 void i(); | 51 void i(); |
44 } | 52 } |
45 static interface I1{ | 53 static interface I1{ |
63 testMemberMethods(c); | 71 testMemberMethods(c); |
64 testMemberFields(c); | 72 testMemberFields(c); |
65 } | 73 } |
66 | 74 |
67 static void testMemberMethods(C<? extends A, ? extends I> arg) { | 75 static void testMemberMethods(C<? extends A, ? extends I> arg) { |
68 arg.t.a(); | 76 arg.t.a1(); |
69 arg.t.b(); | 77 arg.t.a2(); |
78 arg.t.a3(); | |
79 arg.t.b1(); | |
80 arg.t.b2(); | |
81 arg.t.b3(); | |
70 arg.t.i1(); | 82 arg.t.i1(); |
71 arg.w.a(); | 83 arg.w.a1(); |
72 arg.w.b(); | 84 arg.w.a2(); |
85 arg.w.a3(); | |
86 arg.w.b1(); | |
87 arg.w.b2(); | |
88 arg.w.b3(); | |
73 arg.w.i1(); | 89 arg.w.i1(); |
74 } | 90 } |
75 | 91 |
76 static void testMemberFields(C<? extends A, ? extends I> arg) { | 92 static void testMemberFields(C<? extends A, ? extends I> arg) { |
77 A ta = arg.t.a; | 93 A ta; B tb; |
78 B tb = arg.t.b; | 94 ta = arg.t.a1; |
79 A wa = arg.w.a; | 95 ta = arg.t.a2; |
80 B wb = arg.w.b; | 96 ta = arg.t.a3; |
97 tb = arg.t.b1; | |
98 tb = arg.t.b2; | |
99 tb = arg.t.b3; | |
100 ta = arg.w.a1; | |
101 ta = arg.w.a2; | |
102 ta = arg.w.a3; | |
103 tb = arg.w.b1; | |
104 tb = arg.w.b2; | |
105 tb = arg.w.b3; | |
81 } | 106 } |
82 } | 107 } |