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.builder/src/org/eclipse/jdt/core/groovy/tests/search/GenericInferencingTests.java
Copy file name to clipboardExpand all lines: base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovySimpleTests.java
+2-2
Original file line number
Diff line number
Diff line change
@@ -2515,8 +2515,8 @@ public void testMissingTypesForGeneratedBindingsGivesNPE_GRE273() {
2515
2515
" \n" +
2516
2516
" boolean isValid(String newValue) {\n" +
2517
2517
" try {\n" +
2518
-
" return validators.inject(true) {\n" +
2519
-
" prev, cur -> prev && cur.call([newValue, source])\n" +
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
+1-1
Original file line number
Diff line number
Diff line change
@@ -1834,7 +1834,7 @@ public void testCompileStatic8389a() {
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
+188-28
Original file line number
Diff line number
Diff line change
@@ -237,6 +237,148 @@ public void testTypeChecked10() {
" new TypedProperty<T, Unknown>(clazz: clazz)\n" +
1417
1575
" }\n" +
1418
-
// Note: type argument of Holder cannot be supplied to value attribute of @DelegatesTo
1419
-
" def <T> T of(@DelegatesTo(value=Holder, strategy=Closure.DELEGATE_FIRST) Closure<T> c) {\n" +
1576
+
" def <U> U of(@DelegatesTo(value=Holder, strategy=Closure.DELEGATE_FIRST) Closure<U> c) {\n" +
1577
+
// ^^^^^^ type argument cannot be supplied using value attribute
1420
1578
" this.with(c)\n" +
1421
1579
" }\n" +
1422
1580
"}\n" +
1423
-
"class TypedProperty<X, Y> {\n" +
1424
-
" Class<X> clazz\n" +
1425
-
" void eq(X x) {\n" +
1426
-
" assert x.class == clazz : \"x.class is ${x.class} not ${clazz}\"\n" +
1581
+
"class TypedProperty<V, Unused> {\n" +
1582
+
" Class<V> clazz\n" +
1583
+
" void eq(V that) {\n" +
1584
+
" assert that.class == this.lclazz : \"that.class is ${that.class} not ${this.clazz}\"\n" +
1427
1585
" }\n" +
1428
1586
"}\n" +
1429
1587
"@groovy.transform.TypeChecked\n" +
@@ -1448,12 +1606,12 @@ public void testTypeChecked9902() {
1448
1606
"2. ERROR in Main.groovy (at line 21)\n" +
1449
1607
"\tstringProperty.eq(1234)\n" +
1450
1608
"\t^^^^^^^^^^^^^^^^^^^^^^^\n" +
1451
-
"Groovy:[Static type checking] - Cannot call TypedProperty#eq(java.lang.String) with arguments [int]\n" +
1609
+
"Groovy:[Static type checking] - Cannot find matching method TypedProperty#eq(int). Please check if the declared type is correct and if the method exists.\n" +
1452
1610
"----------\n" +
1453
1611
"3. ERROR in Main.groovy (at line 22)\n" +
1454
1612
"\tnumberProperty.eq('xx')\n" +
1455
1613
"\t^^^^^^^^^^^^^^^^^^^^^^^\n" +
1456
-
"Groovy:[Static type checking] - Cannot call TypedProperty#eq(java.lang.Number) with arguments [java.lang.String]\n" +
1614
+
"Groovy:[Static type checking] - Cannot find matching method TypedProperty#eq(java.lang.String). Please check if the declared type is correct and if the method exists.\n" +
1457
1615
"----------\n");
1458
1616
}
1459
1617
@@ -1504,23 +1662,25 @@ public void testTypeChecked9907() {
1504
1662
1505
1663
@Test
1506
1664
publicvoidtestTypeChecked9915() {
1507
-
//@formatter:off
1508
-
String[] sources = {
1509
-
"Main.groovy",
1510
-
"@groovy.transform.TypeChecked\n" +
1511
-
"class C {\n" +
1512
-
" void m() {\n" +
1513
-
" init(Collections.emptyList())\n" + // Cannot call C#init(List<String>) with arguments [List<T>]
0 commit comments