Skip to content

Commit cb5e3a8

Browse files
committed
GROOVY-9800
1 parent 0c731d7 commit cb5e3a8

File tree

8 files changed

+80
-139
lines changed

8 files changed

+80
-139
lines changed

base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/StaticCompilationTests.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public void testCompileStatic12() {
333333
"1. ERROR in Main.groovy (at line 3)\n" +
334334
"\tdef list = new LinkedList<String>([1,2,3])\n" +
335335
"\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.List<java.lang.Integer>] \n" +
337337
"----------\n");
338338
}
339339

@@ -1744,7 +1744,7 @@ public void testCompileStatic8310() {
17441744
"1. ERROR in Main.groovy (at line 6)\n" +
17451745
"\tbar {\n" +
17461746
"\t^\n" +
1747-
"Groovy:[Static type checking] - Cannot find matching method Main#bar(groovy.lang.Closure <java.util.List>). Please check if the declared type is correct and if the method exists.\n" +
1747+
"Groovy:[Static type checking] - Cannot find matching method Main#bar(groovy.lang.Closure<java.util.List<java.lang.Integer>>). Please check if the declared type is correct and if the method exists.\n" +
17481748
"----------\n");
17491749
}
17501750

@@ -2004,7 +2004,7 @@ public void testCompileStatic8609c() {
20042004
"1. ERROR in A.groovy (at line 11)\n" +
20052005
"\tassert record.is(a.getFirstRecord(list))\n" +
20062006
"\t ^^^^^^^^^^^^^^^^^^^^^^\n" +
2007-
"Groovy:[Static type checking] - Cannot find matching method A#getFirstRecord(java.util.ArrayList <TreeMap>). Please check if the declared type is correct and if the method exists.\n" +
2007+
"Groovy:[Static type checking] - Cannot find matching method A#getFirstRecord(java.util.ArrayList<java.util.TreeMap<java.lang.String, java.lang.Integer>>). Please check if the declared type is correct and if the method exists.\n" +
20082008
"----------\n");
20092009
}
20102010

@@ -2034,7 +2034,7 @@ public void testCompileStatic8609d() {
20342034
"1. ERROR in A.groovy (at line 11)\n" +
20352035
"\tassert record.is(a.getFirstRecord(list))\n" +
20362036
"\t ^^^^^^^^^^^^^^^^^^^^^^\n" +
2037-
"Groovy:[Static type checking] - Cannot find matching method A#getFirstRecord(java.util.ArrayList <HashMap>). Please check if the declared type is correct and if the method exists.\n" +
2037+
"Groovy:[Static type checking] - Cannot find matching method A#getFirstRecord(java.util.ArrayList<java.util.HashMap<java.lang.String, java.lang.Long>>). Please check if the declared type is correct and if the method exists.\n" +
20382038
"----------\n");
20392039
}
20402040

@@ -2064,7 +2064,7 @@ public void testCompileStatic8609e() {
20642064
"1. ERROR in A.groovy (at line 11)\n" +
20652065
"\tassert record.is(a.getFirstRecord(list))\n" +
20662066
"\t ^^^^^^^^^^^^^^^^^^^^^^\n" +
2067-
"Groovy:[Static type checking] - Cannot find matching method A#getFirstRecord(java.util.ArrayList <HashMap>). Please check if the declared type is correct and if the method exists.\n" +
2067+
"Groovy:[Static type checking] - Cannot find matching method A#getFirstRecord(java.util.ArrayList<java.util.HashMap<java.lang.StringBuffer, java.lang.Integer>>). Please check if the declared type is correct and if the method exists.\n" +
20682068
"----------\n");
20692069
}
20702070

@@ -4551,7 +4551,7 @@ public void testCompileStatic9338() {
45514551
"1. ERROR in Main.groovy (at line 7)\n" +
45524552
"\tmeth(c)\n" +
45534553
"\t^^^^^^^\n" +
4554-
"Groovy:[Static type checking] - Cannot call Main#meth(java.lang.Class <? extends java.lang.CharSequence>) with arguments [java.lang.Class <?>] \n" +
4554+
"Groovy:[Static type checking] - Cannot call Main#meth(java.lang.Class<? extends java.lang.CharSequence>) with arguments [java.lang.Class<?>] \n" +
45554555
"----------\n");
45564556
}
45574557

@@ -4577,7 +4577,7 @@ public void testCompileStatic9338a() {
45774577
"1. ERROR in Main.groovy (at line 7)\n" +
45784578
"\tmeth(c)\n" +
45794579
"\t^^^^^^^\n" +
4580-
"Groovy:[Static type checking] - Cannot call Main#meth(java.lang.Class <? super java.lang.CharSequence>) with arguments [java.lang.Class <?>] \n" +
4580+
"Groovy:[Static type checking] - Cannot call Main#meth(java.lang.Class<? super java.lang.CharSequence>) with arguments [java.lang.Class<?>] \n" +
45814581
"----------\n");
45824582
}
45834583

@@ -5751,7 +5751,7 @@ public void testCompileStatic9883() {
57515751
"\tjava.util.function.Supplier<String> p = {\n" +
57525752
"\t ^\n" +
57535753
"Groovy:[Static type checking] - Incompatible generic argument types. " +
5754-
"Cannot assign java.util.function.Supplier <java.util.UUID> to: java.util.function.Supplier <String>\n" +
5754+
"Cannot assign java.util.function.Supplier<java.util.UUID> to: java.util.function.Supplier<java.lang.String>\n" +
57555755
"----------\n");
57565756
}
57575757

base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/TypeCheckedTests.java

+31-31
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void testTypeChecked3() {
103103
};
104104
//@formatter:on
105105

106-
runConformTest(sources, "");
106+
runConformTest(sources);
107107
}
108108

109109
@Test
@@ -234,7 +234,7 @@ public void testTypeChecked10() {
234234
};
235235
//@formatter:on
236236

237-
runConformTest(sources, "");
237+
runConformTest(sources);
238238
}
239239

240240
@Test
@@ -254,7 +254,7 @@ public void testTypeChecked6232() {
254254
};
255255
//@formatter:on
256256

257-
runConformTest(sources, "");
257+
runConformTest(sources);
258258
}
259259

260260
@Test
@@ -338,7 +338,7 @@ public void testTypeChecked6912() {
338338
};
339339
//@formatter:on
340340

341-
runConformTest(sources, "");
341+
runConformTest(sources);
342342
}
343343

344344
@Test
@@ -359,7 +359,7 @@ public void testTypeChecked6912a() {
359359
};
360360
//@formatter:on
361361

362-
runConformTest(sources, "");
362+
runConformTest(sources);
363363
}
364364

365365
@Test
@@ -375,13 +375,13 @@ public void testTypeChecked6938() {
375375
"@TypeChecked\n" +
376376
"class G extends J<Integer> {\n" +
377377
" Integer doSomething() {\n" +
378-
" @ASTTest(phase=CLASS_GENERATION, value={\n" +
378+
" @ASTTest(phase=INSTRUCTION_SELECTION, value={\n" +
379379
" def expr = node.rightExpression\n" +
380380
" assert expr instanceof MethodCallExpression\n" +
381381
" assert expr.objectExpression.text == 'super'\n" +
382382

383383
" def type = expr.objectExpression.getNodeMetaData(INFERRED_TYPE)\n" +
384-
" assert type.toString(false) == 'J <Integer>'\n" + // was "J<T>"
384+
" assert type.toString(false) == 'J<java.lang.Integer>'\n" + // was "J<T>"
385385
" type = node.leftExpression.getNodeMetaData(INFERRED_TYPE)\n" +
386386
" assert type.toString(false) == 'java.lang.Integer'\n" +
387387
" })\n" +
@@ -420,7 +420,7 @@ public void testTypeChecked7106() {
420420
};
421421
//@formatter:on
422422

423-
runConformTest(sources, "");
423+
runConformTest(sources);
424424
}
425425

426426
@Test
@@ -437,7 +437,7 @@ public void testTypeChecked7128() {
437437
};
438438
//@formatter:on
439439

440-
runConformTest(sources, "");
440+
runConformTest(sources);
441441
}
442442

443443
@Test
@@ -462,7 +462,7 @@ public void testTypeChecked7128a() {
462462
};
463463
//@formatter:on
464464

465-
runConformTest(sources, "");
465+
runConformTest(sources);
466466
}
467467

468468
@Test
@@ -482,7 +482,7 @@ public void testTypeChecked7128b() {
482482
};
483483
//@formatter:on
484484

485-
runConformTest(sources, "");
485+
runConformTest(sources);
486486
}
487487
}
488488

@@ -504,7 +504,7 @@ public void testTypeChecked7128c() {
504504
"1. ERROR in Main.groovy (at line 3)\n" +
505505
"\tMap<String,Integer> map = [1:2]\n" +
506506
"\t ^^^^^\n" +
507-
"Groovy:[Static type checking] - Incompatible generic argument types. Cannot assign java.util.LinkedHashMap <java.lang.Integer, java.lang.Integer> to: java.util.Map <String, Integer>\n" +
507+
"Groovy:[Static type checking] - Incompatible generic argument types. Cannot assign java.util.LinkedHashMap<java.lang.Integer, java.lang.Integer> to: java.util.Map<java.lang.String, java.lang.Integer>\n" +
508508
"----------\n");
509509
}
510510

@@ -527,7 +527,7 @@ public void testTypeChecked7128d() {
527527
};
528528
//@formatter:on
529529

530-
runConformTest(sources, "");
530+
runConformTest(sources);
531531
}
532532

533533
@Test
@@ -545,7 +545,7 @@ public void testTypeChecked7274() {
545545
};
546546
//@formatter:on
547547

548-
runConformTest(sources, "");
548+
runConformTest(sources);
549549
}
550550

551551
@Test
@@ -624,7 +624,7 @@ public void testTypeChecked7945() {
624624
"1. ERROR in Test.groovy (at line 12)\n" +
625625
"\tsuper(Integer, String)\n" +
626626
"\t^^^^^^^^^^^^^^^^^^^^^^\n" +
627-
"Groovy:[Static type checking] - Cannot call A#<init>(java.lang.Class <String>, java.lang.Class <Integer>) with arguments [java.lang.Class <java.lang.Integer>, java.lang.Class <java.lang.String>] \n" +
627+
"Groovy:[Static type checking] - Cannot call A#<init>(java.lang.Class<java.lang.String>, java.lang.Class<java.lang.Integer>) with arguments [java.lang.Class<java.lang.Integer>, java.lang.Class<java.lang.String>] \n" +
628628
"----------\n");
629629
}
630630

@@ -739,7 +739,7 @@ public void testTypeChecked8909() {
739739
};
740740
//@formatter:on
741741

742-
runConformTest(sources, "");
742+
runConformTest(sources);
743743
}
744744

745745
@Test
@@ -762,7 +762,7 @@ public void testTypeChecked8909a() {
762762
"1. ERROR in Main.groovy (at line 5)\n" +
763763
"\tm([1,2,3])\n" +
764764
"\t^^^^^^^^^^\n" +
765-
"Groovy:[Static type checking] - Cannot find matching method Main#m(java.util.List <java.lang.Integer>). Please check if the declared type is correct and if the method exists.\n" +
765+
"Groovy:[Static type checking] - Cannot find matching method Main#m(java.util.List<java.lang.Integer>). Please check if the declared type is correct and if the method exists.\n" +
766766
"----------\n");
767767
}
768768

@@ -862,12 +862,12 @@ public void testTypeChecked8984() {
862862
"1. ERROR in Main.groovy (at line 4)\n" +
863863
"\tCharSequence[] one = m()\n" +
864864
"\t ^^^\n" +
865-
"Groovy:[Static type checking] - Cannot assign value of type java.util.List <? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
865+
"Groovy:[Static type checking] - Cannot assign value of type java.util.List<? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
866866
"----------\n" +
867867
"2. ERROR in Main.groovy (at line 5)\n" +
868868
"\tCharSequence[] two = set\n" +
869869
"\t ^^^\n" +
870-
"Groovy:[Static type checking] - Cannot assign value of type java.util.Set <? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
870+
"Groovy:[Static type checking] - Cannot assign value of type java.util.Set<? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
871871
"----------\n");
872872
}
873873

@@ -891,12 +891,12 @@ public void testTypeChecked8984a() {
891891
"1. ERROR in Main.groovy (at line 4)\n" +
892892
"\tNumber[] one = m()\n" +
893893
"\t ^^^\n" +
894-
"Groovy:[Static type checking] - Cannot assign value of type java.util.List <String> to variable of type java.lang.Number[]\n" +
894+
"Groovy:[Static type checking] - Cannot assign value of type java.util.List<java.lang.String> to variable of type java.lang.Number[]\n" +
895895
"----------\n" +
896896
"2. ERROR in Main.groovy (at line 5)\n" +
897897
"\tNumber[] two = set\n" +
898898
"\t ^^^\n" +
899-
"Groovy:[Static type checking] - Cannot assign value of type java.util.Set <String> to variable of type java.lang.Number[]\n" +
899+
"Groovy:[Static type checking] - Cannot assign value of type java.util.Set<java.lang.String> to variable of type java.lang.Number[]\n" +
900900
"----------\n");
901901
}
902902

@@ -1474,7 +1474,7 @@ public void testTypeChecked9953() {
14741474
};
14751475
//@formatter:on
14761476

1477-
runConformTest(sources, "");
1477+
runConformTest(sources);
14781478
}
14791479

14801480
@Test
@@ -1496,7 +1496,7 @@ public void testTypeChecked9956() {
14961496
};
14971497
//@formatter:on
14981498

1499-
runConformTest(sources, "");
1499+
runConformTest(sources);
15001500
}
15011501

15021502
@Test
@@ -1520,7 +1520,7 @@ public void testTypeChecked9956a() {
15201520
};
15211521
//@formatter:on
15221522

1523-
runConformTest(sources, "");
1523+
runConformTest(sources);
15241524
}
15251525

15261526
@Test
@@ -1544,7 +1544,7 @@ public void testTypeChecked9956b() {
15441544
"1. ERROR in Main.groovy (at line 7)\n" +
15451545
"\tA<String> ax = new C<Number>()\n" +
15461546
"\t ^^^^^^^^^^^^^^^\n" +
1547-
"Groovy:[Static type checking] - Incompatible generic argument types. Cannot assign C <Number> to: A <String>\n" +
1547+
"Groovy:[Static type checking] - Incompatible generic argument types. Cannot assign C<java.lang.Number> to: A<java.lang.String>\n" +
15481548
"----------\n");
15491549
}
15501550

@@ -1621,7 +1621,7 @@ public void testTypeChecked9970() {
16211621
};
16221622
//@formatter:on
16231623

1624-
runConformTest(sources, "");
1624+
runConformTest(sources);
16251625
}
16261626

16271627
@Test
@@ -1744,7 +1744,7 @@ public void testTypeChecked9972c() {
17441744
};
17451745
//@formatter:on
17461746

1747-
runConformTest(sources, "");
1747+
runConformTest(sources);
17481748
}
17491749

17501750
@Test
@@ -1921,7 +1921,7 @@ public void testTypeChecked9996() {
19211921
};
19221922
//@formatter:on
19231923

1924-
runConformTest(sources, "");
1924+
runConformTest(sources);
19251925
}
19261926

19271927
@Test
@@ -1938,7 +1938,7 @@ public void testTypeChecked9997() {
19381938
};
19391939
//@formatter:on
19401940

1941-
runConformTest(sources, "");
1941+
runConformTest(sources);
19421942
}
19431943

19441944
@Test
@@ -2031,7 +2031,7 @@ public void testTypeChecked10006() {
20312031
};
20322032
//@formatter:on
20332033

2034-
runConformTest(sources, "");
2034+
runConformTest(sources);
20352035
}
20362036

20372037
@Test
@@ -2134,7 +2134,7 @@ public void testTypeChecked10011() {
21342134
};
21352135
//@formatter:on
21362136

2137-
runConformTest(sources, "");
2137+
runConformTest(sources);
21382138
}
21392139

21402140
@Test

0 commit comments

Comments
 (0)