Debian Codegraph @

framework/tests/lubglb/IntersectionTypes.java

raw
1 import lubglb.quals.*;
2
3 interface Foo {}
4
5 interface Bar {}
6
7 class Baz implements Foo, Bar {}
8
9 class IntersectionTypes {
10 <S extends @B Foo & @C Bar> void call1(S p) {}
11
12 <T extends @C Bar & @B Foo> void call2(T p) {}
13
14 void foo1(@D Baz baz1) {
15 call1(baz1);
16 call2(baz1);
17 }
18
19 void foo2(@F Baz baz2) {
20 call1(baz2);
21 call2(baz2);
22 }
23
24 void foo3(@B Baz baz3) {
25 // :: error: (type.argument.type.incompatible)
26 call1(baz3);
27 // :: error: (type.argument.type.incompatible)
28 call2(baz3);
29 }
30 }