mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 23:20:57 +07:00
38 lines
869 B
Java
38 lines
869 B
Java
class SampleExtendsWildcard {
|
|
public void highlightsTheBug(Stream<String> stream) {
|
|
stream.flatMap((Block<?> sink, String element) -> {});
|
|
}
|
|
|
|
public interface Block<B> {
|
|
void apply(B t);
|
|
}
|
|
|
|
public interface Stream<S> {
|
|
<R> Stream<R> flatMap(FlatMapper<? super S, R> mapper);
|
|
|
|
}
|
|
|
|
public interface FlatMapper<F, R> {
|
|
void flatMapInto(Block<? extends R> sink, F element);
|
|
}
|
|
}
|
|
|
|
class SampleSuperWildcard {
|
|
public void highlightsTheBug(Stream<String> stream) {
|
|
stream.flatMap(<error descr="Cannot infer functional interface type">(Block<?> sink, String element) -> {}</error>);
|
|
}
|
|
|
|
public interface Block<B> {
|
|
void apply(B t);
|
|
}
|
|
|
|
public interface Stream<S> {
|
|
<R> Stream<R> flatMap(FlatMapper<? super S, R> mapper);
|
|
|
|
}
|
|
|
|
public interface FlatMapper<F, R> {
|
|
void flatMapInto(Block<? super R> sink, F element);
|
|
}
|
|
}
|