testdata: ensure overload resolution by return type should not take place for interrupted control flow

This commit is contained in:
Anna Kozlova
2014-04-22 20:02:44 +02:00
parent 9aa2f3aaac
commit 5b91054564
2 changed files with 18 additions and 0 deletions
@@ -0,0 +1,14 @@
class Test {
interface I1 {String m();}
interface I2 {void m();}
void call(I1 p) { }
void call(I2 p) { }
void test() {
call<error descr="Ambiguous method call: both 'Test.call(I1)' and 'Test.call(I2)' match">(() -> { throw new RuntimeException(); })</error>;
call(() -> { if (true) return ""; throw new RuntimeException(); });
call(() -> { if (true) return; throw new RuntimeException(); });
}
}