1 /**
2 * @test /nodynamiccopyright/
3 * @summary Verify that definite assignment works (illegal code)
4 * @compile/fail/ref=DefiniteAssignment2.out -XDrawDiagnostics --enable-preview -source ${jdk.version} DefiniteAssignment2.java
5 */
6 public class DefiniteAssignment2 {
7
8 public static void main(String[] args) {
9 int a = 0;
10 E e = E.A;
11
12 {
13 int x;
14
15 switch(a) {
16 case 0: break;
17 default: x = 1; break;
18 }
19
20 System.err.println(x);
21 }
22
23 {
24 int x;
|
1 /**
2 * @test /nodynamiccopyright/
3 * @summary Verify that definite assignment works (illegal code)
4 * @compile/fail/ref=DefiniteAssignment2.out -XDrawDiagnostics DefiniteAssignment2.java
5 */
6 public class DefiniteAssignment2 {
7
8 public static void main(String[] args) {
9 int a = 0;
10 E e = E.A;
11
12 {
13 int x;
14
15 switch(a) {
16 case 0: break;
17 default: x = 1; break;
18 }
19
20 System.err.println(x);
21 }
22
23 {
24 int x;
|