mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
lambda: intersection type produces conjunction of abstract methods
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import java.io.Serializable;
|
||||
|
||||
class Test {
|
||||
|
||||
interface I {
|
||||
void foo();
|
||||
}
|
||||
|
||||
interface A {
|
||||
void bar(int i);
|
||||
}
|
||||
|
||||
{
|
||||
Object o1 = (Serializable & I) () -> {};
|
||||
Object o2 = (I & Serializable) () -> {};
|
||||
Object o3 = (I & Runnable) <error descr="Multiple non-overriding abstract methods found in Runnable & I">() -> {}</error>;
|
||||
Object o4 = (A & Runnable) <error descr="Multiple non-overriding abstract methods found in Runnable & A">() -> {}</error>;
|
||||
Object o5 = (Runnable & A) <error descr="Multiple non-overriding abstract methods found in Runnable & A">() -> {}</error>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user