mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
method reference: preserve all conflicts to have navigation target
This commit is contained in:
@@ -264,6 +264,9 @@ public class MethodReferenceResolver implements ResolveCache.PolyVariantContextR
|
||||
return !firstCandidates.isEmpty() ? firstCandidates.get(0) : secondCandidates.get(0);
|
||||
}
|
||||
|
||||
if (firstCandidates.isEmpty() && secondCandidates.isEmpty() && conflicts.size() > 1) {
|
||||
return null;
|
||||
}
|
||||
conflicts.clear();
|
||||
firstCandidates.addAll(secondCandidates);
|
||||
conflicts.addAll(firstCandidates);
|
||||
|
||||
@@ -27,7 +27,7 @@ class AlienTest {
|
||||
static {
|
||||
IInt i1 = MyTest::<error descr="Cannot resolve method 'abracadabra'">abracadabra</error>;
|
||||
IInt i2 = MyTest::<error descr="Cannot resolve method 'foo'">foo</error>;
|
||||
IInt i3 = MyTest::<error descr="Cannot resolve method 'bar'">bar</error>;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'AlienTest.IInt'">IInt i3 = MyTest::bar;</error>
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'AlienTest.IIntInt'">IIntInt i4 = MyTest::bar;</error>
|
||||
IInt i5 = <error descr="Non-static method cannot be referenced from a static context">MyTest::baz</error>;
|
||||
IInt i6 = <error descr="'foo(int)' is not public in 'MyTest.Foo'. Cannot be accessed from outside package">MyTest.foo::foo</error>;
|
||||
|
||||
@@ -129,7 +129,7 @@ class MyTest4 {
|
||||
}
|
||||
|
||||
{
|
||||
bar(MyTest4:: <error descr="Cannot resolve method 'foo'">foo</error>);
|
||||
bar<error descr="'bar(todelete.MyTest4.Bar1)' in 'todelete.MyTest4' cannot be applied to '(<method reference>)'">(MyTest4:: foo)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class Test {
|
||||
|
||||
class Test1 {
|
||||
{
|
||||
Runnable b = Test1 :: <error descr="Cannot resolve method 'length'">length</error>;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'java.lang.Runnable'">Runnable b = Test1 :: length;</error>
|
||||
Comparable<String> c = Test1 :: length;
|
||||
Comparable<Integer> c1 = Test1 :: length;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ class NonStaticInner3 {
|
||||
}
|
||||
|
||||
{
|
||||
I3<Foo> b1 = Foo::<error descr="Cannot resolve constructor 'Foo'">new</error>;
|
||||
I4<Foo> b2 = Foo::<error descr="Cannot resolve constructor 'Foo'">new</error>;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'NonStaticInner3.I3<NonStaticInner3.Foo>'">I3<Foo> b1 = Foo::new;</error>
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'NonStaticInner3.I4<NonStaticInner3.Foo>'">I4<Foo> b2 = Foo::new;</error>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class MyTest {
|
||||
I1 i1 = MyTest::static_1;
|
||||
I1 i2 = MyTest::<error descr="Cannot resolve method 'static_2'">static_2</error>;
|
||||
I1 i3 = MyTest::<error descr="Cannot resolve method 'static_3'">static_3</error>;
|
||||
I1 i4 = MyTest::<error descr="Cannot resolve method 'static_4'">static_4</error>;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'MyTest.I1'">I1 i4 = MyTest::static_4;</error>
|
||||
}
|
||||
|
||||
|
||||
@@ -58,12 +58,12 @@ class MyTest {
|
||||
I1 i_1 = <error descr="Non-static method cannot be referenced from a static context">MyTest::_1</error>;
|
||||
I1 i_2 = MyTest::<error descr="Cannot resolve method '_2'">_2</error>;
|
||||
I1 i_3 = MyTest::<error descr="Cannot resolve method '_3'">_3</error>;
|
||||
I1 i_4 = MyTest::<error descr="Cannot resolve method '_4'">_4</error>;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'MyTest.I1'">I1 i_4 = MyTest::_4;</error>
|
||||
|
||||
I1 i1 = this::_1;
|
||||
I1 i2 = this::<error descr="Cannot resolve method '_2'">_2</error>;
|
||||
I1 i3 = this::<error descr="Cannot resolve method '_3'">_3</error>;
|
||||
I1 i4 = this::<error descr="Cannot resolve method '_4'">_4</error>;
|
||||
<error descr="Incompatible types. Found: '<method reference>', required: 'MyTest.I1'">I1 i4 = this::_4;</error>
|
||||
|
||||
I2 i21 = MyTest::<error descr="Cannot resolve method 'm1'">m1</error>;
|
||||
I2 i22 = MyTest::<error descr="Cannot resolve method 'm2'">m2</error>;
|
||||
|
||||
Reference in New Issue
Block a user