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
+72-2
Original file line number
Diff line number
Diff line change
@@ -4066,6 +4066,28 @@ public void testCompileStatic9127() {
4066
4066
runConformTest(sources, "bar");
4067
4067
}
4068
4068
4069
+
@Test
4070
+
publicvoidtestCompileStatic9132() {
4071
+
assumeTrue(isParrotParser());
4072
+
4073
+
//@formatter:off
4074
+
String[] sources = {
4075
+
"Main.groovy",
4076
+
"import java.util.function.Function\n" +
4077
+
"def <R> R transform(Function<? super String, ? extends R> f) {\n" +
4078
+
" f.apply('foo')\n" +
4079
+
"}\n" +
4080
+
"@groovy.transform.CompileStatic\n" +
4081
+
"void test() {\n" +
4082
+
" print(transform(String::length) * 3)\n" +
4083
+
"}\n" +
4084
+
"test()\n",
4085
+
};
4086
+
//@formatter:on
4087
+
4088
+
runConformTest(sources, "9");
4089
+
}
4090
+
4069
4091
@Test
4070
4092
publicvoidtestCompileStatic9136() {
4071
4093
//@formatter:off
@@ -5756,6 +5778,26 @@ public void testCompileStatic9799() {
5756
5778
runConformTest(sources, "works");
5757
5779
}
5758
5780
5781
+
@Test(expected = AssertionError.class) // see GROOVY-10047
Copy file name to clipboardExpand all lines: base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/TypeCheckedTests.java
+57-6
Original file line number
Diff line number
Diff line change
@@ -601,6 +601,34 @@ public void testTypeChecked6455() {
601
601
runConformTest(sources);
602
602
}
603
603
604
+
@Test
605
+
publicvoidtestTypeChecked6731() {
606
+
if (Float.parseFloat(System.getProperty("java.specification.version")) > 8)
"Groovy:[Static type checking] - Cannot assign value of type java.io.Serializable<? extends java.io.Serializable<java.lang.String>> to variable of type java.lang.Integer\n" +
4669
4722
"----------\n");
4670
4723
}
4671
4724
@@ -4714,9 +4767,7 @@ public void testTypeChecked10347a() {
0 commit comments