1 /**
2 * @test /nodynamiccopyright/
3 * @bug 8214031
4 * @summary Verify that definite assignment when true works (illegal code)
5 * @compile/fail/ref=DefiniteAssignment2.out --enable-preview --source 12 -XDrawDiagnostics DefiniteAssignment2.java
6 */
7 public class DefiniteAssignment2 {
8
9 public static void main(String[] args) {
10 int a = 0;
11 boolean b = true;
12 boolean t;
13
14 {
15 int x;
16
17 t = (b && switch(a) {
18 case 0: break (x = 1) == 1 || true;
19 default: break false;
20 }) || x == 1;
21 }
22
23 {
24 int x;
25
|
1 /**
2 * @test /nodynamiccopyright/
3 * @bug 8214031
4 * @summary Verify that definite assignment when true works (illegal code)
5 * @compile/fail/ref=DefiniteAssignment2.out --enable-preview --source 13 -XDrawDiagnostics DefiniteAssignment2.java
6 */
7 public class DefiniteAssignment2 {
8
9 public static void main(String[] args) {
10 int a = 0;
11 boolean b = true;
12 boolean t;
13
14 {
15 int x;
16
17 t = (b && switch(a) {
18 case 0: break (x = 1) == 1 || true;
19 default: break false;
20 }) || x == 1;
21 }
22
23 {
24 int x;
25
|