aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pureJava/UnderIfFalse.java
blob: 2e905f3628a21c31190c7e9a981518d1fb9a26f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// modeled on jacks 16.2.7-final-4: A final variable
//        must be definitely unassigned if it
//        is to be assigned inside an if (false) block.
// if false is no protection for evildoers

public class UnderIfFalse {
    static int foo() { return 0; }
    static final int val = foo();
    public static void main(String[] args) {
	if (false) {
	    val = 1;
	}
    }
}