summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/ReturnTypeCompatibilityBeforeSpecificsCheck.java
blob: 70583e906788afd1e797bc7a30b9613d3d67f2e4 (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
class X {
    public static void main(final Stream<String> stream) throws Throwable {
        stream.map(s -> s.substring("http://".length())).forEach(System.out::println);
    }
}

interface Stream<T> {
    <R> Stream<R> map(Function<? super T, ? extends R> mapper);
    IntStream map(IntFunction<? super T> mapper);
    void forEach(Block<? super T> block);
}

interface IntFunction<T> extends Function<T, Integer> {
    public int applyAsInt(T t);
}

interface Function<T, R> {
    public R apply(T t);
}

interface IntStream extends BaseStream<Integer> {}
interface BaseStream<T> {}
interface Block<T> {
    public void accept(T t);
}