don't show error on method reference if functional expression is located inside invalid context without target functional type

This commit is contained in:
Anna Kozlova
2015-12-10 19:52:16 +01:00
parent b21cde7b47
commit 132bb137a1
19 changed files with 38 additions and 32 deletions

View File

@@ -12,7 +12,7 @@ class Test {
void m(LongMapper... lm) { }
{
m(this ::<error descr="Cannot resolve method 'ii'">ii</error>);
m<error descr="Ambiguous method call: both 'Test.m(IntMapper, IntMapper...)' and 'Test.m(LongMapper...)' match">(this ::ii)</error>;
}
int ii() {return 0;}

View File

@@ -32,12 +32,12 @@ class Test {
meth1(Foo::<error descr="Cannot resolve constructor 'Foo'">new</error>);
meth2(Foo::new);
meth3(Foo::<error descr="Cannot resolve constructor 'Foo'">new</error>);
meth4(Foo::<error descr="Cannot resolve constructor 'Foo'">new</error>);
meth4<error descr="Ambiguous method call: both 'Test.meth4(I1)' and 'Test.meth4(I2)' match">(Foo::new)</error>;
meth1(Test::<error descr="Cannot resolve method 'foo'">foo</error>);
meth2(Test::foo);
meth3(Test::<error descr="Cannot resolve method 'foo'">foo</error>);
meth4(Test::<error descr="Cannot resolve method 'foo'">foo</error>);
meth4<error descr="Ambiguous method call: both 'Test.meth4(I1)' and 'Test.meth4(I2)' match">(Test::foo)</error>;
}

View File

@@ -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<error descr="Ambiguous method call: both 'Test.instanceCall(I0)' and 'Test.instanceCall(I1<String>)' match">(this::m01)</error>;
String i5 = instanceCall<error descr="Ambiguous method call: both 'Test.instanceCall(I0)' and 'Test.instanceCall(I1<String>)' match">(this::m012)</error>;
}
void n0() { }
@@ -52,8 +52,8 @@ class Test {
static {
Test s1 = staticCall(Test::n0);
Test s2 = staticCall(Test::n1);
Test s3 = <error descr="Cannot resolve method 'staticCall(<method reference>)'">staticCall</error>(Test::<error descr="Cannot resolve method 'n2'">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 s3 = <error descr="Cannot resolve method 'staticCall(<method reference>)'">staticCall</error>(Test::n2);
Test s4 = staticCall<error descr="Ambiguous method call: both 'Test.staticCall(I1<Test>)' and 'Test.staticCall(I2<Test, String>)' match">(Test::n01)</error>;
Test s5 = staticCall<error descr="Ambiguous method call: both 'Test.staticCall(I1<Test>)' and 'Test.staticCall(I2<Test, String>)' match">(Test::n012)</error>;
}
}

View File

@@ -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<error descr="Ambiguous method call: both 'Test.replyWith(Function<String, List<String>>)' and 'Test.replyWith(Callable<List<String>>)' match">(this::query1)</error>;
System.out.println(m1);
}
}