Debian Codegraph @

framework/tests/all-systems/java8/memberref/Issue946.java

raw
1 // Test case for Issue 946
2 // https://github.com/typetools/checker-framework/issues/946
3
4 interface Supply946<R> {
5 R supply();
6 }
7
8 class Issue946 {
9 class MethodRefInnerA {
10 // this line of code causes a crash in CF
11 Supply946<MethodRefInnerB> constructorReferenceField = MethodRefInnerB::new;
12
13 MethodRefInnerA(Issue946 Issue946.this) {
14 // this line of code also causes a crash in CF
15 Supply946<MethodRefInnerB> constructorReference = MethodRefInnerB::new;
16 }
17
18 void method() {
19 // and so does this line
20 Supply946<MethodRefInnerB> constructorReference = MethodRefInnerB::new;
21 }
22
23 class MethodRefInnerAInner {
24 void method() {
25 Supply946<MethodRefInnerB> constructorReference = MethodRefInnerB::new;
26 }
27 }
28 }
29
30 class MethodRefInnerB {
31 MethodRefInnerB(Issue946 Issue946.this) {}
32
33 void method() {
34 Supply946<MethodRefInnerB> constructorReference = MethodRefInnerB::new;
35 }
36 }
37
38 void method() {
39 Supply946<MethodRefInnerB> constructorReference = MethodRefInnerB::new;
40 }
41 }