test/tools/javac/lambda/MethodReference43.java

Mon, 23 Jun 2014 13:14:32 -0700

author
rfield
date
Mon, 23 Jun 2014 13:14:32 -0700
changeset 2528
eb284abd64fe
parent 2015
a4b9a8859e58
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8046060: Different results of floating point multiplication for lambda code block
Summary: propogate strictfp into lambda body
Reviewed-by: vromero, jlahoda

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 }

mercurial