test/tools/javac/lambda/8023549/T8023549.java

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

author
rfield
date
Mon, 23 Jun 2014 13:14:32 -0700
changeset 2528
eb284abd64fe
parent 0
959103a6100f
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

aoqi@0 1 /*
aoqi@0 2 * @test /nodynamiccopyright/
aoqi@0 3 * @bug 8023549
aoqi@0 4 * @summary Compiler emitting spurious errors when constructor reference type is inferred and explicit type arguments are supplied
aoqi@0 5 * @compile/fail/ref=T8023549.out -XDrawDiagnostics T8023549.java
aoqi@0 6 */
aoqi@0 7
aoqi@0 8 public class T8023549 {
aoqi@0 9 static class Foo<X> { }
aoqi@0 10
aoqi@0 11 interface Supplier<X> {
aoqi@0 12 X make();
aoqi@0 13 }
aoqi@0 14
aoqi@0 15 interface ExtSupplier<X> extends Supplier<X> { }
aoqi@0 16
aoqi@0 17 void m1(Supplier<Foo<String>> sfs) { }
aoqi@0 18
aoqi@0 19 void m2(Supplier<Foo<String>> sfs) { }
aoqi@0 20 void m2(ExtSupplier<Foo<Integer>> sfs) { }
aoqi@0 21
aoqi@0 22 void test() {
aoqi@0 23 Supplier<Foo<String>> sfs = Foo::<Number>new;
aoqi@0 24 m1(Foo::<Number>new);
aoqi@0 25 m2(Foo::<Number>new);
aoqi@0 26 }
aoqi@0 27 }

mercurial