java error message: explicit method reference ambiguity (IDEA-250654)

GitOrigin-RevId: 1fc5f577f298a7f874a111866a394aa7a6c09cc0
This commit is contained in:
Anna Kozlova
2020-09-14 18:40:35 +00:00
committed by intellij-monorepo-bot
parent aff9c8468a
commit 34526b2b5c
15 changed files with 40 additions and 37 deletions
@@ -16,7 +16,7 @@ class DemoApplicationTests {
Stream.of("")
.map(l -> a.get(l.length()))
.map(s -> new DemoApplicationTests()).findAny()
.map(d -> d.foo(this::<error descr="Cannot resolve method 'bar'">ba<caret>r</error>));
.map(d -> d.foo(this::<error descr="Reference to 'bar' is ambiguous, both 'bar(long)' and 'bar(int)' match">bar</error>));
}
<T> void foo(Consumer<T> c) {}
@@ -31,8 +31,8 @@ class Test {
String i1 = instanceCall(this::m0);
String i2 = instanceCall(this::m1);
String i3 = instanceCall(this::m2);
String i4 = instanceCall(this::<error descr="Cannot resolve method 'm01'">m01</error>);
String i5 = instanceCall(this::<error descr="Cannot resolve method 'm012'">m012</error>);
String i4 = instanceCall(this::<error descr="Reference to 'm01' is ambiguous, both 'm01()' and 'm01(String)' match">m01</error>);
String i5 = instanceCall(this::<error descr="Reference to 'm012' is ambiguous, both 'm012()' and 'm012(String)' match">m012</error>);
}
void n0() { }
@@ -53,7 +53,7 @@ class Test {
Test s1 = staticCall(Test::n0);
Test s2 = staticCall(Test::n1);
Test s3 = staticCall<error descr="Cannot resolve method 'staticCall(<method reference>)'">(Test::n2)</error>;
Test s4 = staticCall(Test::<error descr="Cannot resolve method 'n01'">n01</error>);
Test s5 = staticCall(Test::<error descr="Cannot resolve method 'n012'">n012</error>);
Test s4 = staticCall(Test::<error descr="Reference to 'n01' is ambiguous, both 'n01()' and 'n01(String)' match">n01</error>);
Test s5 = staticCall(Test::<error descr="Reference to 'n012' is ambiguous, both 'n012()' and 'n012(String)' match">n012</error>);
}
}
@@ -34,7 +34,7 @@ class Test {
{
Set<String> m = replyWith(this::query);
System.out.println(m);
Set<String> m1 = replyWith(this::<error descr="Cannot resolve method 'query1'">query1</error>);
Set<String> m1 = replyWith(this::<error descr="Reference to 'query1' is ambiguous, both 'query1()' and 'query1(String)' match">query1</error>);
System.out.println(m1);
}
}
@@ -10,6 +10,6 @@ class Test {
static void m(Test t, Object s) {}
static void test() {
I i = Test::<error descr="Cannot resolve method 'm'">m</error>;
I i = Test::<error descr="Reference to 'm' is ambiguous, both 'm(Test, String)' and 'm(String)' match">m</error>;
}
}