Thu, 10 Oct 2013 14:58:04 +0200
8001931: The new build system whitespace cleanup
Reviewed-by: tbell, simonis, erikj
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8003280
4 * @summary Add lambda tests
5 * spurious exceptions when checking references to inner constructors where
6 * the enclosing class is not defined in any outer context
7 * @compile/fail/ref=MethodReference37.out -XDrawDiagnostics MethodReference37.java
8 */
10 class MethodReference37 {
12 interface SAM1<R> {
13 R invoke();
14 }
16 interface SAM2<R, A> {
17 R invoke(A a);
18 }
20 static class Outer {
21 class Inner { }
23 static void test1() {
24 SAM2<Inner, Outer> sam = Inner::new;
25 }
27 void test2() {
28 SAM1<Inner> sam0 = Inner::new;
29 SAM2<Inner, Outer> sam1 = Inner::new;
30 }
31 }
33 static void test1() {
34 SAM2<Outer.Inner, Outer> sam = Outer.Inner::new;
35 }
37 void test2() {
38 SAM2<Outer.Inner, Outer> sam1 = Outer.Inner::new;
39 }
40 }