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
+1-1
Original file line number
Diff line number
Diff line change
@@ -333,7 +333,7 @@ public void testCompileStatic12() {
333
333
"1. ERROR in Main.groovy (at line 3)\n" +
334
334
"\tdef list = new LinkedList<String>([1,2,3])\n" +
335
335
"\t ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
336
-
"Groovy:[Static type checking] - Cannot call java.util.LinkedList#<init>(java.util.Collection<? extends java.lang.String>) with arguments [java.util.List<java.lang.Integer>]\n" +
336
+
"Groovy:[Static type checking] - Cannot call java.util.LinkedList#<init>(java.util.Collection<? extends java.lang.String>) with arguments [java.util.ArrayList<java.lang.Integer>]\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/TypeCheckedTests.java
+64
Original file line number
Diff line number
Diff line change
@@ -5166,4 +5166,68 @@ public void testTypeChecked10419() {
5166
5166
5167
5167
runConformTest(sources, "C(x)");
5168
5168
}
5169
+
5170
+
@Test
5171
+
publicvoidtestTypeChecked10482() {
5172
+
//@formatter:off
5173
+
String[] sources = {
5174
+
"Main.groovy",
5175
+
"class Foo<X> {\n" +
5176
+
" Foo(X x) {\n" +
5177
+
" }\n" +
5178
+
"}\n" +
5179
+
"def <Y> Y bar() {\n" +
5180
+
"}\n" +
5181
+
"@groovy.transform.TypeChecked\n" +
5182
+
"def <Z> void baz() {\n" +
5183
+
" new Foo<Z>(bar())\n" + // Cannot call Foo#<init>(Z) with arguments [#Y]
5184
+
"}\n" +
5185
+
"this.<String>baz()\n",
5186
+
};
5187
+
//@formatter:on
5188
+
5189
+
runConformTest(sources);
5190
+
}
5191
+
5192
+
@Test
5193
+
publicvoidtestTypeChecked10482a() {
5194
+
//@formatter:off
5195
+
String[] sources = {
5196
+
"Main.groovy",
5197
+
"class Foo<X> {\n" +
5198
+
" Foo(X x) {\n" +
5199
+
" }\n" +
5200
+
"}\n" +
5201
+
"static <Y> Y bar() {\n" +
5202
+
"}\n" +
5203
+
"@groovy.transform.TypeChecked\n" +
5204
+
"static <Z> void baz() {\n" +
5205
+
" new Foo<Z>(bar())\n" + // Cannot call Foo#<init>(Z) with arguments [#Y]
0 commit comments