aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pureJava/TypeExprErrors.java
blob: b11afbf0e84e61d3241eddfb3599c8578a3e0e8b (plain)
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
// errors on lines:
// 10 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 36 37

public class TypeExprErrors {
    static String s;
    static boolean b;
    static A a;

    TypeExprErrors() {
        this(A);
    }

    TypeExprErrors(Object o) {
    }

    static {
        s += A;
        a = A;
        f(A);
        f((A) A);
        f(b ? A : a);
        f(b ? a : A);
        new TypeExprErrors(A);
        ff(a == A);
        ff(A == a);
        ff(A != a);
        ff(a != A);
        ff(A != null);
        ff(null != A);
        ff(A == null);
        ff(null == A);
        ff(A instanceof A);
        f(new A[] { A });
        (A).m();
        (A).sm();               // not actually an error
        f(s + A);
        f(A + s);
    }

    static void f(Object o) {
    }
    static void ff(boolean b) {
    }
}

class A {
    void m() {}
    static void sm() {}
}