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/TypeCheckedTests.java
+73
Original file line number
Diff line number
Diff line change
@@ -6021,4 +6021,77 @@ public void testTypeChecked10673() {
6021
6021
6022
6022
runConformTest(sources, "1");
6023
6023
}
6024
+
6025
+
@Test
6026
+
publicvoidtestTypeChecked10699() {
6027
+
for (Stringtype : newString[] {"java.util.function.Function<T,T>", "java.util.function.UnaryOperator<T>"}) {
6028
+
//@formatter:off
6029
+
String[] sources = {
6030
+
"Main.groovy",
6031
+
"def <T> void m(" + type + " f) {\n" +
6032
+
" print(f.apply(null))\n" +
6033
+
"}\n" +
6034
+
"@groovy.transform.TypeChecked\n" +
6035
+
"void test() {\n" +
6036
+
" m { Double d -> d }\n" +
6037
+
"}\n" +
6038
+
"test()\n",
6039
+
};
6040
+
//@formatter:on
6041
+
6042
+
runConformTest(sources, "null");
6043
+
}
6044
+
}
6045
+
6046
+
@Test
6047
+
publicvoidtestTypeChecked10700() {
6048
+
//@formatter:off
6049
+
String[] sources = {
6050
+
"Main.groovy",
6051
+
"class D extends C {\n" + // implements A
6052
+
" @groovy.transform.TypeChecked\n" +
6053
+
" void test() {\n" +
6054
+
" print(decode('works'))\n" +
6055
+
" }\n" +
6056
+
"}\n" +
6057
+
"new D().test()\n",
6058
+
6059
+
"Peer.groovy",
6060
+
"interface A {\n" +
6061
+
" String decode(String s)\n" +
6062
+
"}\n" +
6063
+
"class B implements A {\n" +
6064
+
" String decode(String s) { s }\n" +
6065
+
"}\n" +
6066
+
"class C implements A {\n" +
6067
+
" @Delegate(interfaces=false)\n" +
6068
+
" private final B b = new B()\n" +
6069
+
"}\n",
6070
+
};
6071
+
//@formatter:on
6072
+
6073
+
runConformTest(sources, "works");
6074
+
}
6075
+
6076
+
@Test
6077
+
publicvoidtestTypeChecked10701() {
6078
+
//@formatter:off
6079
+
String[] sources = {
6080
+
"Main.groovy",
6081
+
"def <T> T m1(java.util.function.UnaryOperator<T> op) {\n" +
0 commit comments