summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/methodRef/VarargsInReceiverPosition.java
blob: cf2151dc76d8f80d7921b7305b5cd9b9971f414d (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
import java.util.*;

class Test {
    void test() {
        Comparator<Test> r2 = Test::yyy;
        Comparator1<Test> c1 = <error descr="Non-static method cannot be referenced from a static context">Test::yyy</error>;
        <error descr="Incompatible types. Found: '<method reference>', required: 'Comparator1<Test>'">Comparator1<Test> c2 = Test::xxx;</error>
    }
    int yyy(Test... p) { return 1; }
    int xxx(Test t) {return 42;}
}

interface Comparator1<T> {
    int compare(T... o1);
}


class Test1 {
    void test() {
        Bar2 bar2 = Test1::yyy;
    }

    void yyy(Test1... p) {}

    interface Bar2 {
      public void xxx(Test1 p, Test1... ps);
    }
}