Thu, 10 Oct 2013 14:58:04 +0200
8001931: The new build system whitespace cleanup
Reviewed-by: tbell, simonis, erikj
mcimadamore@1415 | 1 | /* |
vromero@2015 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@1415 | 3 | * @bug 8003280 |
mcimadamore@1415 | 4 | * @summary Add lambda tests |
mcimadamore@1415 | 5 | * check that diamond inference is applied when using raw constructor reference qualifier |
vromero@2000 | 6 | * @compile/fail/ref=MethodReference43.out -XDrawDiagnostics MethodReference43.java |
mcimadamore@1415 | 7 | */ |
vromero@2015 | 8 | |
mcimadamore@1415 | 9 | public class MethodReference43 { |
mcimadamore@1415 | 10 | |
mcimadamore@1415 | 11 | interface SAM1 { |
mcimadamore@1415 | 12 | Foo<?> m(String s); |
mcimadamore@1415 | 13 | } |
mcimadamore@1415 | 14 | |
mcimadamore@1415 | 15 | interface SAM2 { |
mcimadamore@1415 | 16 | Foo<?> m(Integer s); |
mcimadamore@1415 | 17 | } |
mcimadamore@1415 | 18 | |
mcimadamore@1415 | 19 | interface SAM3 { |
mcimadamore@1415 | 20 | Foo<?> m(Object o); |
mcimadamore@1415 | 21 | } |
mcimadamore@1415 | 22 | |
mcimadamore@1415 | 23 | interface SAM4 { |
mcimadamore@1415 | 24 | Foo<Number> m(Integer o); |
mcimadamore@1415 | 25 | } |
mcimadamore@1415 | 26 | |
mcimadamore@1415 | 27 | static class Foo<X extends Number> { |
mcimadamore@1415 | 28 | Foo(X x) { } |
mcimadamore@1415 | 29 | } |
mcimadamore@1415 | 30 | |
vromero@2000 | 31 | static void m1(SAM1 s) { } |
mcimadamore@1415 | 32 | |
vromero@2000 | 33 | static void m2(SAM2 s) { } |
vromero@2000 | 34 | |
vromero@2000 | 35 | static void m3(SAM3 s) { } |
vromero@2000 | 36 | |
vromero@2000 | 37 | static void m4(SAM4 s) { } |
vromero@2000 | 38 | |
vromero@2000 | 39 | static void m5(SAM1 s) { } |
vromero@2000 | 40 | static void m5(SAM2 s) { } |
vromero@2000 | 41 | static void m5(SAM3 s) { } |
vromero@2000 | 42 | static void m5(SAM4 s) { } |
mcimadamore@1415 | 43 | |
mcimadamore@1415 | 44 | public static void main(String[] args) { |
vromero@2000 | 45 | m1(Foo::new); |
vromero@2000 | 46 | m2(Foo::new); |
vromero@2000 | 47 | m3(Foo::new); |
vromero@2000 | 48 | m4(Foo::new); |
vromero@2000 | 49 | m5(Foo::new); |
mcimadamore@1415 | 50 | } |
mcimadamore@1415 | 51 | } |