8003280: Add lambda tests

Turn on lambda expression, method reference and default method support

Reviewed-by: jjg
This commit is contained in:
Maurizio Cimadamore 2012-11-17 19:01:03 +00:00
parent c39f1d99b4
commit a494f0ab86
451 changed files with 15433 additions and 488 deletions

View file

@ -0,0 +1,31 @@
/*
* @test /nodynamiccopyright/
* @bug 8003280
* @summary Add lambda tests
* speculative cache contents are overwritten by deferred type-checking of nested stuck expressions
* @compile/fail/ref=MostSpecific07.out -XDrawDiagnostics MostSpecific07.java
*/
import java.util.*;
class MostSpecific07 {
interface Predicate<X, Y> {
Y accept(X x);
}
interface VoidMapper {
void accept();
}
interface ExtPredicate<X, Y> extends Predicate<X, Y> { }
void test(boolean cond, ArrayList<String> als, VoidMapper vm) {
m(u -> ()->{}, als, als, vm);
m((u -> ()->{}), als, als, vm);
m(cond ? u -> ()->{} : u -> ()->{}, als, als, vm);
}
<U, V> U m(Predicate<U, V> p, List<U> lu, ArrayList<U> au, V v) { return null; }
<U, V> U m(ExtPredicate<U, V> ep, ArrayList<U> au, List<U> lu, V v) { return null; }
}