You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/StaticCompilationTests.java
+43-37
Original file line number
Diff line number
Diff line change
@@ -1280,6 +1280,30 @@ public void testCompileStatic7363() {
1280
1280
runConformTest(sources, "42");
1281
1281
}
1282
1282
1283
+
@Test
1284
+
publicvoidtestCompileStatic7526() {
1285
+
//@formatter:off
1286
+
String[] sources = {
1287
+
"Main.groovy",
1288
+
"boolean check(String s) { true }\n" +
1289
+
"@groovy.transform.CompileStatic\n" +
1290
+
"void test(Pogo pogo) {\n" +
1291
+
" if (check(pogo?.field)) {\n" + // VerifyError: Bad type on operand stack
1292
+
" print 'works'\n" +
1293
+
" }\n" +
1294
+
"}\n" +
1295
+
"test(new Pogo())\n",
1296
+
1297
+
"Pogo.groovy",
1298
+
"class Pogo {\n" +
1299
+
" public String field\n" +
1300
+
"}\n",
1301
+
};
1302
+
//@formatter:on
1303
+
1304
+
runConformTest(sources, "works");
1305
+
}
1306
+
1283
1307
@Test
1284
1308
publicvoidtestCompileStatic7549() {
1285
1309
//@formatter:off
@@ -5136,42 +5160,24 @@ public void testCompileStatic9555() {
5136
5160
5137
5161
@Test
5138
5162
publicvoidtestCompileStatic9558() {
5139
-
//@formatter:off
5140
-
String[] sources = {
5141
-
"Main.groovy",
5142
-
"@groovy.transform.CompileStatic\n" +
5143
-
"void test() {\n" +
5144
-
" def config = new org.codehaus.groovy.control.CompilerConfiguration()\n" +
5145
-
" config.tap {\n" +
5146
-
" optimizationOptions['indy'] = true\n" + // Cannot cast object '...' with class 'CompilerConfiguration' to class 'Map'
5147
-
" optimizationOptions.indy = true\n" +
5148
-
" }\n" +
5149
-
"}\n" +
5150
-
"test()\n",
5151
-
};
5152
-
//@formatter:on
5153
-
5154
-
runConformTest(sources, "");
5155
-
}
5156
-
5157
-
@Test
5158
-
publicvoidtestCompileStatic9558a() {
5159
-
//@formatter:off
5160
-
String[] sources = {
5161
-
"Main.groovy",
5162
-
"@groovy.transform.CompileStatic\n" +
5163
-
"void test() {\n" +
5164
-
" def config = new org.codehaus.groovy.control.CompilerConfiguration()\n" +
5165
-
" config.with {\n" +
5166
-
" optimizationOptions['indy'] = true\n" + // Cannot cast object '...' with class 'CompilerConfiguration' to class 'Map'
5167
-
" optimizationOptions.indy = true\n" +
5168
-
" }\n" +
5169
-
"}\n" +
5170
-
"test()\n",
5171
-
};
5172
-
//@formatter:on
5163
+
for (Stringdgm : newString[] {"tap", "with"}) {
5164
+
//@formatter:off
5165
+
String[] sources = {
5166
+
"Main.groovy",
5167
+
"@groovy.transform.CompileStatic\n" +
5168
+
"void test() {\n" +
5169
+
" def config = new org.codehaus.groovy.control.CompilerConfiguration()\n" +
5170
+
" config." + dgm + " {\n" +
5171
+
" optimizationOptions['indy'] = true\n" + // Cannot cast object '...' with class 'CompilerConfiguration' to class 'Map'
5172
+
" optimizationOptions.indy = true\n" +
5173
+
" }\n" +
5174
+
"}\n" +
5175
+
"test()\n",
5176
+
};
5177
+
//@formatter:on
5173
5178
5174
-
runConformTest(sources, "");
5179
+
runConformTest(sources);
5180
+
}
5175
5181
}
5176
5182
5177
5183
@Test
@@ -5272,7 +5278,7 @@ public void testCompileStatic9603() {
5272
5278
};
5273
5279
//@formatter:on
5274
5280
5275
-
runConformTest(sources, "");
5281
+
runConformTest(sources);
5276
5282
}
5277
5283
5278
5284
@Test
@@ -6348,7 +6354,7 @@ public void testCompileStatic10089() {
6348
6354
6349
6355
@Test
6350
6356
publicvoidtestCompileStatic10197() {
6351
-
for (Stringoverride : newString[]{"int getBaz() {1}", "final int baz = 1"}) {
6357
+
for (Stringoverride : newString[]{"int getBaz() {1}", "final int baz = 1"}) {
0 commit comments