mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-16 17:14:41 +02:00
8003280: Add lambda tests
Turn on lambda expression, method reference and default method support Reviewed-by: jjg
This commit is contained in:
parent
c39f1d99b4
commit
a494f0ab86
451 changed files with 15433 additions and 488 deletions
31
langtools/test/tools/javac/lambda/MostSpecific07.java
Normal file
31
langtools/test/tools/javac/lambda/MostSpecific07.java
Normal 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; }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue