new overload resolution: reject explicitly typed lambda to be pertinent to applicability if any of its return expressions is not

This commit is contained in:
Anna Kozlova
2014-09-03 13:26:10 +04:00
parent 83c2d36544
commit 5fc5b2b300
4 changed files with 75 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
abstract class PertinentToApplicabilityOfExplicitlyTypedLambdaTest {
interface A {
B m(int a);
}
interface B {
int m(int b);
}
abstract void foo(A a);
abstract void foo(B b);
{
foo<error descr="Ambiguous method call: both 'PertinentToApplicabilityOfExplicitlyTypedLambdaTest.foo(A)' and 'PertinentToApplicabilityOfExplicitlyTypedLambdaTest.foo(B)' match">(x -> y -> 42)</error>;
}
}