fix code to compile under java 11 as well

This commit is contained in:
Anna.Kozlova
2019-02-11 18:39:48 +01:00
parent 396ac72d12
commit bb01072eb6
3 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import java.util.function.Predicate;
class B<T> {
public static <E> B<E> from( Iterable<? extends E> iterable) {
return null;
}
void m(Iterable<? extends T> it, Predicate<? super T> p) {
<error descr="Incompatible types. Found: 'B<capture<? extends T>>', required: 'B<T>'">B<T> B = from(it).bar(not(p));</error>
}
B<T> bar(Predicate<? super T> p) {
return this;
}
public static <N> Predicate<N> not(Predicate<? super N> c) {
return null;
}
}