method references: don't swallow errors during method ref inference (IDEA-179706)

This commit is contained in:
Anna.Kozlova
2017-09-29 12:30:27 +02:00
parent 81730cbe8e
commit 9728678ff4
13 changed files with 76 additions and 18 deletions

View File

@@ -24,7 +24,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 i2 = MyTest::<error descr="Incompatible types: int is not convertible to String">foo</error>;
IInt i3 = MyTest::<error descr="Cannot resolve method 'bar'">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>;

View File

@@ -47,7 +47,7 @@ class MyTest1 {
}
{
Bar1 b1 = MyTest2 :: <error descr="Cannot resolve method 'foo'">foo</error>;
Bar1 b1 = MyTest2 :: <error descr="Incompatible types: String is not convertible to int">foo</error>;
bar(MyTest1 :: foo);
}
}
@@ -73,7 +73,7 @@ class MyTest2 {
}*/
{
Bar1 b1 = MyTest2 :: <error descr="Cannot resolve method 'foo'">foo</error>;
Bar1 b1 = MyTest2 :: <error descr="Incompatible types: String is not convertible to int">foo</error>;
bar(MyTest2 :: foo);
}
}
@@ -99,8 +99,8 @@ class MyTest3 {
}
{
Bar1 b1 = MyTest2 :: <error descr="Cannot resolve method 'foo'">foo</error>;
bar(MyTest3 :: <error descr="Cannot resolve method 'foo'">foo</error>);
Bar1 b1 = MyTest2 :: <error descr="Incompatible types: String is not convertible to int">foo</error>;
bar(MyTest3 :: <error descr="Incompatible types: int is not convertible to String">foo</error>);
}
}

View File

@@ -2,7 +2,7 @@ class Test {
{
Runnable b = Test :: <error descr="Cannot resolve method 'length'">length</error>;
Comparable<String> c = Test :: length;
Comparable<Integer> c1 = Test :: <error descr="Cannot resolve method 'length'">length</error>;
Comparable<Integer> c1 = Test :: <error descr="Incompatible types: Integer is not convertible to String">length</error>;
}
public static Integer length(String s) {

View File

@@ -49,7 +49,7 @@ class MyTest {
static {
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 i3 = MyTest::<error descr="Incompatible types: int is not convertible to String">static_3</error>;
I1 i4 = MyTest::<error descr="Cannot resolve method 'static_4'">static_4</error>;
}
@@ -62,7 +62,7 @@ class MyTest {
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 i3 = this::<error descr="Incompatible types: int is not convertible to String">_3</error>;
I1 i4 = this::<error descr="Cannot resolve method '_4'">_4</error>;
I2 i21 = MyTest::<error descr="Cannot resolve method 'm1'">m1</error>;