new overload resolution: first check that collected methods are potentially compatible with args; for generic methods without specified type arguments this already means that they are applicable; for non generic methods (or raw method calls) expressions should be compatible with parameter types (formal parameter types = actual types as substitutor is known) (IDEA-147798)

This commit is contained in:
Anna Kozlova
2015-11-20 18:15:38 +01:00
parent aded26aa0a
commit 61f120b30e
11 changed files with 146 additions and 43 deletions

View File

@@ -26,7 +26,7 @@ class Foo {
System.out.println(s);
});
<error descr="Cannot resolve method 'foo(<lambda expression>)'">foo</error>((String p, String k) -> {
foo(<error descr="Incompatible parameter types in lambda expression: expected int but found String">(String p, String k)</error> -> {
System.out.println(p);
});
}
@@ -62,7 +62,7 @@ class WithTypeParams {
System.out.println(p);
});
<error descr="Cannot resolve method 'foo(<lambda expression>)'">foo</error>((int k) -> {System.out.println(k);});
foo(<error descr="Incompatible parameter types in lambda expression: expected String but found int">(int k)</error> -> {System.out.println(k);});
}
}
}