Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8003280
4 * @summary Add lambda tests
5 * speculative cache contents are overwritten by deferred type-checking of nested stuck expressions
6 * @compile/fail/ref=MostSpecific07.out -XDrawDiagnostics MostSpecific07.java
7 */
8 import java.util.*;
10 class MostSpecific07 {
12 interface Predicate<X, Y> {
13 Y accept(X x);
14 }
16 interface VoidMapper {
17 void accept();
18 }
20 interface ExtPredicate<X, Y> extends Predicate<X, Y> { }
22 void test(boolean cond, ArrayList<String> als, VoidMapper vm) {
23 m(u -> ()->{}, als, als, vm);
24 m((u -> ()->{}), als, als, vm);
25 m(cond ? u -> ()->{} : u -> ()->{}, als, als, vm);
26 }
28 <U, V> U m(Predicate<U, V> p, List<U> lu, ArrayList<U> au, V v) { return null; }
30 <U, V> U m(ExtPredicate<U, V> ep, ArrayList<U> au, List<U> lu, V v) { return null; }
31 }