File: RawSuper.java

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,104 kB
  • sloc: java: 145,916; xml: 839; sh: 518; makefile: 404; perl: 26
file content (85 lines) | stat: -rw-r--r-- 1,661 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import org.checkerframework.checker.nullness.qual.*;

// @skip-test
// This test is broken as it uses multiple classes.  Javac halts
// when seeing the first error
class RawSuper {

    class A {
        @NonNull Object afield;

        A() {
            super();
            mRA(this);
            // :: error: (type.incompatible)
            mA(this);
            afield = new Object();
            mRA(this);
            mA(this);
        }

        A(int ignore) {
            this.raw();
            afield = new Object();
        }

        void raw(A this) {}

        void nonRaw() {}
    }

    class B extends A {
        @NonNull Object bfield;

        B() {
            mRA(this);
            mA(this);
            mRB(this);
            // :: error: (type.incompatible)
            mB(this);
            bfield = new Object();
            mRA(this);
            mA(this);
            mRB(this);
            mB(this);
        }

        void raw(B this) {
            // :: error: (type.incompatible)
            super.nonRaw();
        }
    }
    // This test may be extraneous
    class C extends B {
        @NonNull Object cfield;

        C() {
            mRA(this);
            mA(this);
            mRB(this);
            mB(this);
            mRC(this);
            // :: error: (type.incompatible)
            mC(this);
            cfield = new Object();
            mRA(this);
            mA(this);
            mRB(this);
            mB(this);
            mRC(this);
            mC(this);
        }
    }

    void mA(A a) {}

    void mRA(A a) {}

    void mB(B b) {}

    void mRB(B b) {}

    void mC(C c) {}

    void mRC(C c) {}
}