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
+69-5
Original file line number
Diff line number
Diff line change
@@ -361,6 +361,35 @@ public void testTypeChecked15() {
361
361
362
362
@Test
363
363
publicvoidtestTypeChecked16() {
364
+
//@formatter:off
365
+
String[] sources = {
366
+
"Main.groovy",
367
+
"@groovy.transform.TypeChecked\n" +
368
+
"void test() {\n" +
369
+
" new Order<Pogo, Comparable>({Pogo p -> p.s})\n" + // No such property s for class Object
370
+
"}\n" +
371
+
"test()\n",
372
+
373
+
"Order.groovy",
374
+
"class Order<T, U extends Comparable<? super U>> {\n" +
375
+
" Order(java.util.function.Function<? super T, ? extends U> keyExtractor) {\n" +
376
+
" }\n" +
377
+
"}\n",
378
+
379
+
"Pogo.groovy",
380
+
"@groovy.transform.Canonical\n" +
381
+
"class Pogo {\n" +
382
+
" Number n\n" +
383
+
" String s\n" +
384
+
"}\n",
385
+
};
386
+
//@formatter:on
387
+
388
+
runConformTest(sources);
389
+
}
390
+
391
+
@Test
392
+
publicvoidtestTypeChecked17() {
364
393
//@formatter:off
365
394
String[] sources = {
366
395
"Main.groovy",
@@ -1079,6 +1108,44 @@ public void testTypeChecked8909a() {
1079
1108
"----------\n");
1080
1109
}
1081
1110
1111
+
@Test
1112
+
publicvoidtestTypeChecked8917() {
1113
+
if (Float.parseFloat(System.getProperty("java.specification.version")) > 8)
* the same time the SAM class is used in the target method parameter,
3117
3186
* providing a connection from the SAM type and the target method's class.
3118
3187
*/
3188
+
/* GRECLIPSE edit
3119
3189
private void inferSAMType(final Parameter param, final ClassNode receiver, final MethodNode methodWithSAMParameter, final ArgumentListExpression originalMethodCallArguments, final ClosureExpression openBlock) {
3120
3190
// first we try to get as much information about the declaration class through the receiver
3121
3191
Map<GenericsTypeName, GenericsType> targetMethodConnections = new HashMap<>();
3122
-
/* GRECLIPSE edit -- GROOVY-10049
3123
3192
for (ClassNode face : receiver.getAllInterfaces()) {
0 commit comments