test/tools/javac/lambda/TargetType20.java

Sat, 17 Nov 2012 19:01:03 +0000

author
mcimadamore
date
Sat, 17 Nov 2012 19:01:03 +0000
changeset 1415
01c9d4161882
child 1562
2154ed9ff6c8
permissions
-rw-r--r--

8003280: Add lambda tests
Summary: Turn on lambda expression, method reference and default method support
Reviewed-by: jjg

mcimadamore@1415 1 /*
mcimadamore@1415 2 * @test /nodynamiccopyright/
mcimadamore@1415 3 * @bug 8003280
mcimadamore@1415 4 * @summary Add lambda tests
mcimadamore@1415 5 * complex case of lambda return type that depends on generic method
mcimadamore@1415 6 * inference variable
mcimadamore@1415 7 * @compile/fail/ref=TargetType20.out -XDrawDiagnostics TargetType20.java
mcimadamore@1415 8 */
mcimadamore@1415 9 import java.util.*;
mcimadamore@1415 10
mcimadamore@1415 11 class TargetType20 {
mcimadamore@1415 12
mcimadamore@1415 13 interface SAM2<X> {
mcimadamore@1415 14 List<X> f();
mcimadamore@1415 15 }
mcimadamore@1415 16
mcimadamore@1415 17 class Test {
mcimadamore@1415 18 <Z> void call(SAM2<Z> x, SAM2<Z> y) { }
mcimadamore@1415 19 { call(() -> Collections.emptyList(), () -> new ArrayList<String>()); }
mcimadamore@1415 20 }
mcimadamore@1415 21 }

mercurial