Thu, 06 Jun 2013 15:33:40 +0100
8008627: Compiler mishandles three-way return-type-substitutability
Summary: Compiler should not enforce an order in how ambiguous methods should be resolved
Reviewed-by: jjg, vromero
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8003280
4 * @summary Add lambda tests
5 * Check void-compatibility in strict vs. loose conversion contexts
6 * @compile/fail/ref=TargetType16.out -XDrawDiagnostics TargetType16.java
7 */
9 class TargetType16 {
11 interface SAM1 {
12 void m1();
13 }
15 interface SAM2<X> {
16 X m2();
17 }
19 static void m(SAM1 s1) { }
20 static <T> void m(SAM2<T> s2) { }
22 public static void main(String[] args) {
23 m(() -> { throw new AssertionError(); }); //ambiguous
24 }
25 }