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

Mon, 14 Oct 2013 23:07:43 -0700

author
jjg
date
Mon, 14 Oct 2013 23:07:43 -0700
changeset 2114
09a414673570
parent 0
959103a6100f
permissions
-rw-r--r--

8025998: Missing LV table in lambda bodies
Reviewed-by: vromero

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