summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/Intersection.java
blob: 7a6312b3089b52f14959f054dabdbb8c4f169754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 I & Runnable">() -> {}</error>;
    Object o4 = (A & Runnable) <error descr="Multiple non-overriding abstract methods found in A & Runnable">() -> {}</error>;
    Object o5 = (Runnable & A) <error descr="Multiple non-overriding abstract methods found in Runnable & A">() -> {}</error>;
  }
}

class Test1 {

  interface A {
    <X> void foo();
  }

  interface B {
    void foo();
  }

  {
    Object c0 = (A & B) ()->{};
  }
}