aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pureJava/NonOverEagerConstantFolding.java
blob: 5ad7bede7d03cc12a02e75382f14b10bfe012007 (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
import org.aspectj.testing.Tester;

class NonOverEagerConstantFolding {
    public static final int i = 3;
    static boolean thingy = false;
    static NonOverEagerConstantFolding foo() {
	thingy = true;
	return null;
    }
    public static void main(String[] args) {
	int j = 3 + foo().i;
	Tester.check(thingy, "didn't evaluate expr part of field access expr");
    }
}
/*
class Test {
    int i = 3;
    class C {
	C() {
	    ++j;
	}
	int j = i + 2;
    }
    void foo() {
	new C();
    }
}
*/