Skip to content

Commit

Permalink
GROOVY-9800
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Apr 18, 2021
1 parent 0c731d7 commit cb5e3a8
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 139 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public void testCompileStatic12() {
"1. ERROR in Main.groovy (at line 3)\n" +
"\tdef list = new LinkedList<String>([1,2,3])\n" +
"\t ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
"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" +
"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" +
"----------\n");
}

Expand Down Expand Up @@ -1744,7 +1744,7 @@ public void testCompileStatic8310() {
"1. ERROR in Main.groovy (at line 6)\n" +
"\tbar {\n" +
"\t^\n" +
"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" +
"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" +
"----------\n");
}

Expand Down Expand Up @@ -2004,7 +2004,7 @@ public void testCompileStatic8609c() {
"1. ERROR in A.groovy (at line 11)\n" +
"\tassert record.is(a.getFirstRecord(list))\n" +
"\t ^^^^^^^^^^^^^^^^^^^^^^\n" +
"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" +
"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" +
"----------\n");
}

Expand Down Expand Up @@ -2034,7 +2034,7 @@ public void testCompileStatic8609d() {
"1. ERROR in A.groovy (at line 11)\n" +
"\tassert record.is(a.getFirstRecord(list))\n" +
"\t ^^^^^^^^^^^^^^^^^^^^^^\n" +
"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" +
"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" +
"----------\n");
}

Expand Down Expand Up @@ -2064,7 +2064,7 @@ public void testCompileStatic8609e() {
"1. ERROR in A.groovy (at line 11)\n" +
"\tassert record.is(a.getFirstRecord(list))\n" +
"\t ^^^^^^^^^^^^^^^^^^^^^^\n" +
"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" +
"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" +
"----------\n");
}

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void testTypeChecked3() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down Expand Up @@ -234,7 +234,7 @@ public void testTypeChecked10() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -254,7 +254,7 @@ public void testTypeChecked6232() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down Expand Up @@ -338,7 +338,7 @@ public void testTypeChecked6912() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -359,7 +359,7 @@ public void testTypeChecked6912a() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -375,13 +375,13 @@ public void testTypeChecked6938() {
"@TypeChecked\n" +
"class G extends J<Integer> {\n" +
" Integer doSomething() {\n" +
" @ASTTest(phase=CLASS_GENERATION, value={\n" +
" @ASTTest(phase=INSTRUCTION_SELECTION, value={\n" +
" def expr = node.rightExpression\n" +
" assert expr instanceof MethodCallExpression\n" +
" assert expr.objectExpression.text == 'super'\n" +

" def type = expr.objectExpression.getNodeMetaData(INFERRED_TYPE)\n" +
" assert type.toString(false) == 'J <Integer>'\n" + // was "J<T>"
" assert type.toString(false) == 'J<java.lang.Integer>'\n" + // was "J<T>"
" type = node.leftExpression.getNodeMetaData(INFERRED_TYPE)\n" +
" assert type.toString(false) == 'java.lang.Integer'\n" +
" })\n" +
Expand Down Expand Up @@ -420,7 +420,7 @@ public void testTypeChecked7106() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -437,7 +437,7 @@ public void testTypeChecked7128() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -462,7 +462,7 @@ public void testTypeChecked7128a() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -482,7 +482,7 @@ public void testTypeChecked7128b() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}
}

Expand All @@ -504,7 +504,7 @@ public void testTypeChecked7128c() {
"1. ERROR in Main.groovy (at line 3)\n" +
"\tMap<String,Integer> map = [1:2]\n" +
"\t ^^^^^\n" +
"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" +
"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" +
"----------\n");
}

Expand All @@ -527,7 +527,7 @@ public void testTypeChecked7128d() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -545,7 +545,7 @@ public void testTypeChecked7274() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down Expand Up @@ -624,7 +624,7 @@ public void testTypeChecked7945() {
"1. ERROR in Test.groovy (at line 12)\n" +
"\tsuper(Integer, String)\n" +
"\t^^^^^^^^^^^^^^^^^^^^^^\n" +
"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" +
"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" +
"----------\n");
}

Expand Down Expand Up @@ -739,7 +739,7 @@ public void testTypeChecked8909() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -762,7 +762,7 @@ public void testTypeChecked8909a() {
"1. ERROR in Main.groovy (at line 5)\n" +
"\tm([1,2,3])\n" +
"\t^^^^^^^^^^\n" +
"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" +
"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" +
"----------\n");
}

Expand Down Expand Up @@ -862,12 +862,12 @@ public void testTypeChecked8984() {
"1. ERROR in Main.groovy (at line 4)\n" +
"\tCharSequence[] one = m()\n" +
"\t ^^^\n" +
"Groovy:[Static type checking] - Cannot assign value of type java.util.List <? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
"Groovy:[Static type checking] - Cannot assign value of type java.util.List<? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
"----------\n" +
"2. ERROR in Main.groovy (at line 5)\n" +
"\tCharSequence[] two = set\n" +
"\t ^^^\n" +
"Groovy:[Static type checking] - Cannot assign value of type java.util.Set <? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
"Groovy:[Static type checking] - Cannot assign value of type java.util.Set<? super java.lang.CharSequence> to variable of type java.lang.CharSequence[]\n" +
"----------\n");
}

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

Expand Down Expand Up @@ -1474,7 +1474,7 @@ public void testTypeChecked9953() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -1496,7 +1496,7 @@ public void testTypeChecked9956() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -1520,7 +1520,7 @@ public void testTypeChecked9956a() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

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

Expand Down Expand Up @@ -1621,7 +1621,7 @@ public void testTypeChecked9970() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down Expand Up @@ -1744,7 +1744,7 @@ public void testTypeChecked9972c() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down Expand Up @@ -1921,7 +1921,7 @@ public void testTypeChecked9996() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand All @@ -1938,7 +1938,7 @@ public void testTypeChecked9997() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down Expand Up @@ -2031,7 +2031,7 @@ public void testTypeChecked10006() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down Expand Up @@ -2134,7 +2134,7 @@ public void testTypeChecked10011() {
};
//@formatter:on

runConformTest(sources, "");
runConformTest(sources);
}

@Test
Expand Down
Loading

0 comments on commit cb5e3a8

Please sign in to comment.