conditional expression: use target type for overload cases when assignable

GitOrigin-RevId: 2be5da156f1726f8536e6fc6447ae847629b0001
This commit is contained in:
Anna Kozlova
2019-05-06 07:48:02 +02:00
committed by intellij-monorepo-bot
parent c8cf98f173
commit 0374b5f49c
3 changed files with 27 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
interface I {
void f();
}
class B implements I {
@Override
public void f() {
}
}
class MyTest {
void m(I i) {}
void n(int ik) {
m(ik > 0 ? () -> {} : new B());
}
}