mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
java highlighting: provide better incompatible types message on failed inference
GitOrigin-RevId: 5f97ec808f753d9ca40c417704ec93a802512745
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6a7856d5c6
commit
afa0706bfc
@@ -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){
|
||||
|
||||
@@ -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>);
|
||||
}
|
||||
}
|
||||
@@ -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[]) {
|
||||
|
||||
Reference in New Issue
Block a user