summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/StaticContexts.java
blob: 18fba8a158429dcdf5b61eb496650d445d27973e (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
public class StaticContexts {
    Object m() { return null; }

    static void s(Object o) {}
    class I extends C {
	I() {
	    super(StaticContexts.this);
	    s(StaticContexts.this);
	}
	I(int x) {
	    super(this);
	    s(this);
	}
	I(float x) {
	    super(m());
	    s(m());
	}
	static void foo() { //ERR: inner class can't have static member
	    s(StaticContexts.this);	    
	    s(this);
	    s(m());
	}
    }

    static class II extends C {
	II() {
	    super(StaticContexts.this);
	    s(StaticContexts.this);
	}
	II(int x) {
	    super(this);
	    s(this);
	}
	II(float x) {
	    super(m());
	    s(m());
	}
    }
}

class C {
    C(Object o) {}
}