test/tools/javac/lambda/TargetType06.java

changeset 1415
01c9d4161882
child 1510
7873d37f5b37
equal deleted inserted replaced
1414:843d3b191773 1415:01c9d4161882
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8003280
4 * @summary Add lambda tests
5 * check complex case of target typing
6 * @author Maurizio Cimadamore
7 * @compile/fail/ref=TargetType06.out -XDrawDiagnostics TargetType06.java
8 */
9
10 import java.util.List;
11
12 class TargetType06 {
13
14 class Foo {
15 Foo getFoo() { return null; }
16 }
17
18 interface Function<A,R> {
19 R invoke(A a);
20 }
21
22 static <B> List<B> map(Function<B, B> function) { return null; }
23
24 void test() {
25 List<Foo> l = map(foo -> foo.getFoo());
26 }
27 }

mercurial