mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 13:39:36 +07:00
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:
@@ -11,12 +11,12 @@ class Test {
|
||||
}
|
||||
|
||||
void test(boolean cond) {
|
||||
m<error descr="Cannot resolve method 'm(<lambda expression>)'">(() -> {
|
||||
<error descr="Cannot resolve method 'm(<lambda expression>)'">m</error>(() -> {
|
||||
if (cond)
|
||||
return 42;
|
||||
else
|
||||
return foo();
|
||||
})</error>;
|
||||
});
|
||||
|
||||
m(() -> {
|
||||
return foo();
|
||||
|
||||
@@ -14,7 +14,7 @@ class Test {
|
||||
}
|
||||
|
||||
void fooBar(IntStream1 instr){
|
||||
Supplier<Stream<Integer>> si = () -> instr.map ((i) -> (( <error descr="Operator '%' cannot be applied to '<lambda parameter>', 'int'">i % 2</error>) == 0) ? i : -i).boxed();
|
||||
Supplier<Stream<Integer>> si = () -> instr.<error descr="Ambiguous method call: both 'IntStream1.map(IntFunction<Integer>)' and 'IntStream1.map(IntUnaryOperator)' match">map</error> ((i) -> (( <error descr="Operator '%' cannot be applied to '<lambda parameter>', 'int'">i % 2</error>) == 0) ? i : -i).boxed();
|
||||
System.out.println(si);
|
||||
Supplier<Stream<Integer>> si1 = () -> instr.map <error descr="Ambiguous method call: both 'IntStream1.map(IntFunction<Integer>)' and 'IntStream1.map(IntUnaryOperator)' match">(null)</error>.boxed();
|
||||
System.out.println(si1);
|
||||
|
||||
@@ -12,6 +12,6 @@ abstract class PertinentToApplicabilityOfExplicitlyTypedLambdaTest {
|
||||
abstract void foo(B b);
|
||||
|
||||
{
|
||||
foo<error descr="Cannot resolve method 'foo(<lambda expression>)'">(x -> y -> 42)</error>;
|
||||
<error descr="Cannot resolve method 'foo(<lambda expression>)'">foo</error>(x -> y -> 42);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@ abstract class Test {
|
||||
foo(x -> {
|
||||
return x += 1;
|
||||
});
|
||||
foo<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">(x -> x += 1)</error>;
|
||||
<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">foo</error>(x -> x += 1);
|
||||
foo(x -> 1);
|
||||
foo(x -> <error descr="Operator '!' cannot be applied to 'int'">!x</error>);
|
||||
foo<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">(x -> ++x)</error>;
|
||||
<error descr="Ambiguous method call: both 'Test.foo(A)' and 'Test.foo(B)' match">foo</error>(x -> ++x);
|
||||
foo(x -> o instanceof String ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user