Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/DontIgnoreIncompatibilitiesDuringFirstApplicabilityCheck.java
2019-10-10 07:01:11 +00:00

20 lines
734 B
Java

import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Supplier;
import java.util.stream.Stream;
class MyTest {
{
Stream<String> stream = Stream.of("a", "b", "c", "d");
Set<Integer> set = stream.collect(()->new TreeSet<Integer>(), TreeSet::<error descr="Incompatible types: String is not convertible to Integer">add</error>, TreeSet::addAll);
}
}
abstract class Simplified {
void m(final BiConsumer<TreeSet<Integer>, TreeSet<Integer>> addAll) {
Set<Integer> set = collect(TreeSet:: <error descr="Incompatible types: String is not convertible to Integer">add</error>, addAll);
}
abstract <R> R collect(BiConsumer<R, String> accumulator, BiConsumer<R, R> combiner);
}