summaryrefslogtreecommitdiffstats
path: root/tests/pureJava/UnderIfFalse.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pureJava/UnderIfFalse.java')
-rw-r--r--tests/pureJava/UnderIfFalse.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pureJava/UnderIfFalse.java b/tests/pureJava/UnderIfFalse.java
new file mode 100644
index 000000000..2e905f362
--- /dev/null
+++ b/tests/pureJava/UnderIfFalse.java
@@ -0,0 +1,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;
+ }
+ }
+}