java highlighting: provide better incompatible types message on failed inference

GitOrigin-RevId: 5f97ec808f753d9ca40c417704ec93a802512745
This commit is contained in:
Anna Kozlova
2019-07-08 10:43:57 +02:00
committed by intellij-monorepo-bot
parent 6a7856d5c6
commit afa0706bfc
28 changed files with 87 additions and 101 deletions

View File

@@ -12,7 +12,7 @@ import java.util.function.Function;
class Test {
{
valueOf(processFirst(<error descr="no instance(s) of type variable(s) exist so that Integer conforms to char[]">x -> x</error>));
valueOf(processFirst(<error descr="Incompatible types. Found: 'java.lang.Object', required: 'char[]'">x -> x</error>));
}
public static <V> V processFirst(Function<Integer,V> f){

View File

@@ -9,7 +9,6 @@ class MyTest {
}
{
new MyTest("", <error descr="Incompatible types. Required int but 'emptyList' was inferred to List<T>:
no instance(s) of type variable(s) T exist so that List<T> conforms to Integer">Collections.emptyList()</error>);
new MyTest("", <error descr="Incompatible types. Found: 'java.util.List<java.lang.Object>', required: 'int'">Collections.emptyList()</error>);
}
}

View File

@@ -6,7 +6,7 @@ import java.util.stream.Stream;
class Test {
void foo() {
log(<error descr="no instance(s) of type variable(s) exist so that TreeSet<String> conforms to String[]">get(TreeSet<String>::new)</error>);
log(<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String[]'">get(TreeSet<String>::new)</error>);
}
private void log(String params[]) {