method reference: distinguish captured wildcards by target parameters (IDEA-170340)

This commit is contained in:
Anna.Kozlova
2017-03-27 17:39:14 +02:00
parent 9f3dfc8629
commit 3da240cba6
4 changed files with 27 additions and 12 deletions

View File

@@ -0,0 +1,11 @@
import java.util.function.BiConsumer;
import java.util.function.Predicate;
class MyTest {
{
BiConsumer<Predicate<? extends Runnable>, Predicate<? extends Runnable>> or = MyTest::<error descr="Invalid method reference: Predicate<capture of ? extends Runnable> cannot be converted to Predicate<E>">or</error>;
}
private static <E extends Runnable> void or(Predicate<E> left, Predicate<E> right) {}
}