author | jlahoda |
Wed, 27 Nov 2019 09:00:01 +0100 | |
changeset 59285 | 7799a51dbe30 |
permissions | -rw-r--r-- |
59285
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
1 |
/* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
4 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
8 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
13 |
* accompanied this code). |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
14 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
18 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
21 |
* questions. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
22 |
*/ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
23 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
24 |
import java.io.IOException; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
25 |
import java.util.Arrays; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
26 |
import java.util.List; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
27 |
import java.util.stream.Collectors; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
28 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
29 |
import org.testng.ITestResult; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
30 |
import org.testng.annotations.AfterMethod; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
31 |
import org.testng.annotations.Test; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
32 |
import tools.javac.combo.JavacTemplateTestBase; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
33 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
34 |
import static java.util.stream.Collectors.toList; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
35 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
36 |
@Test |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
37 |
public class ScopeTest extends JavacTemplateTestBase { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
38 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
39 |
private static String st_block(String... statements) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
40 |
return Arrays.stream(statements).collect(Collectors.joining("", "{", "}")); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
41 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
42 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
43 |
private static String st_if(String condition, String then, String els) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
44 |
return "if (" + condition + ") " + then + " else " + els; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
45 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
46 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
47 |
private static String st_while(String condition, String body) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
48 |
return "while (" + condition + ") " + body; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
49 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
50 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
51 |
private static String st_do_while(String body, String condition) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
52 |
return "do " + body + " while (" + condition + ");"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
53 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
54 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
55 |
private static String st_for(String init, String condition, String update, String body) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
56 |
return "for (" + init + "; " + condition + "; " + update + ") " + body; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
57 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
58 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
59 |
private static String st_s_use() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
60 |
return "s.length();"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
61 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
62 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
63 |
private static String st_break() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
64 |
return "break;"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
65 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
66 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
67 |
private static String st_return() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
68 |
return "return;"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
69 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
70 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
71 |
private static String st_noop() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
72 |
return ";"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
73 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
74 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
75 |
private static String expr_empty() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
76 |
return ""; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
77 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
78 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
79 |
private static String expr_o_match_str() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
80 |
return "o instanceof String s"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
81 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
82 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
83 |
private static String expr_not(String expr) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
84 |
return "!(" + expr + ")"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
85 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
86 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
87 |
@AfterMethod |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
88 |
public void dumpTemplateIfError(ITestResult result) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
89 |
// Make sure offending template ends up in log file on failure |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
90 |
if (!result.isSuccess()) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
91 |
System.err.printf("Diagnostics: %s%nTemplate: %s%n", diags.errorKeys(), sourceFiles.stream().map(p -> p.snd).collect(toList())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
92 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
93 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
94 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
95 |
private void program(String block) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
96 |
String s = "class C { void m(Object o) " + block + "}"; |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
97 |
addSourceFile("C.java", new StringTemplate(s)); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
98 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
99 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
100 |
private void assertOK(String block) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
101 |
String sourceVersion = Integer.toString(Runtime.version().feature()); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
102 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
103 |
reset(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
104 |
addCompileOptions("--enable-preview", "-source", sourceVersion); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
105 |
program(block); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
106 |
try { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
107 |
compile(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
108 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
109 |
catch (IOException e) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
110 |
throw new RuntimeException(e); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
111 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
112 |
assertCompileSucceeded(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
113 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
114 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
115 |
private void assertFail(String expectedDiag, String block) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
116 |
String sourceVersion = Integer.toString(Runtime.version().feature()); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
117 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
118 |
reset(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
119 |
addCompileOptions("--enable-preview", "-source", sourceVersion); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
120 |
program(block); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
121 |
try { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
122 |
compile(); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
123 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
124 |
catch (IOException e) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
125 |
throw new RuntimeException(e); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
126 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
127 |
assertCompileFailed(expectedDiag); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
128 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
129 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
130 |
public void testIf() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
131 |
assertOK(st_block(st_if(expr_o_match_str(), st_s_use(), st_return()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
132 |
assertOK(st_block(st_if(expr_not(expr_o_match_str()), st_return(), st_s_use()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
133 |
assertFail("compiler.err.cant.resolve.location", st_block(st_if(expr_o_match_str(), st_s_use(), st_noop()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
134 |
assertFail("compiler.err.cant.resolve.location", st_block(st_if(expr_not(expr_o_match_str()), st_noop(), st_s_use()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
135 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
136 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
137 |
public void testWhile() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
138 |
assertOK(st_block(st_while(expr_not(expr_o_match_str()), st_noop()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
139 |
assertFail("compiler.err.cant.resolve.location", st_block(st_while(expr_not(expr_o_match_str()), st_break()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
140 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
141 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
142 |
public void testDoWhile() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
143 |
assertOK(st_block(st_do_while(st_noop(), expr_not(expr_o_match_str())), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
144 |
assertFail("compiler.err.cant.resolve.location", st_block(st_do_while(st_break(), expr_not(expr_o_match_str())), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
145 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
146 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
147 |
public void testFor() { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
148 |
assertOK(st_block(st_for(expr_empty(), expr_not(expr_o_match_str()), expr_empty(), st_noop()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
149 |
assertFail("compiler.err.cant.resolve.location", st_block(st_for(expr_empty(), expr_not(expr_o_match_str()), expr_empty(), st_break()), st_s_use())); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
150 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
151 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
diff
changeset
|
152 |
} |