lambda: highlight containing method ambiguity on method name: this avoids lots of lines of lambda body to be highlighted and it would show errors even if lambda body contains errors actually caused by the ambiguity on the parent level (IDEA-141580)

This commit is contained in:
Anna Kozlova
2015-06-18 17:54:23 +03:00
parent 1b3a089335
commit 30a12275a2
22 changed files with 57 additions and 55 deletions
@@ -23,7 +23,7 @@ class Test {
void test() {
call(() -> { });
call<error descr="Ambiguous method call: both 'Test.call(I1)' and 'Test.call(IVarargs)' match">(p1 -> { })</error>;
<error descr="Ambiguous method call: both 'Test.call(I1)' and 'Test.call(IVarargs)' match">call</error>(p1 -> { });
call((p1, p2) -> {});
}
}
@@ -7,6 +7,6 @@ class Test {
public static void call(I i) { }
public static void main(String[] args) {
call<error descr="Ambiguous method call: both 'Test.call(IStr)' and 'Test.call(I)' match">(()-> null)</error>;
<error descr="Ambiguous method call: both 'Test.call(IStr)' and 'Test.call(I)' match">call</error>(()-> null);
}
}
@@ -12,7 +12,7 @@ class MS {
void test(boolean cond) {
m(cond ? () -> 26 : () -> 24);
m<error descr="Cannot resolve method 'm(?)'">(cond ? () -> 26 : () -> new Integer(42))</error>;
<error descr="Cannot resolve method 'm(?)'">m</error>(cond ? () -> 26 : () -> new Integer(42));
m(cond ? () -> new Integer(26) : () -> new Integer(42));
}
}
@@ -22,7 +22,7 @@ class Test {
}
public void test() {
foo<error descr="Ambiguous method call: both 'Test.foo(RunnableX)' and 'Test.foo(Callable<List<?>>)' match">(()-> new ArrayList<Void>() )</error>;
<error descr="Ambiguous method call: both 'Test.foo(RunnableX)' and 'Test.foo(Callable<List<?>>)' match">foo</error>(()-> new ArrayList<Void>() );
}
}
@@ -3,7 +3,7 @@ import java.util.function.Supplier;
class Test {
public static void main(String... args) {
c<error descr="Cannot resolve method 'c(<lambda expression>, <lambda expression>)'">(() -> 3, () -> 10)</error>;
<error descr="Cannot resolve method 'c(<lambda expression>, <lambda expression>)'">c</error>(() -> 3, () -> 10);
}
public static <T> void c(Supplier<T> s1, Supplier<T> s2) {}