Part F - Question

Srikanth S Adayapalam srikanth_sankaran at in.ibm.com
Tue Nov 26 00:16:42 PST 2013


Hello !

1. javac 8b116 refuses to compile this program ("reference to goo is 
ambiguous"):
Per my reading, the reference compiler is indeed closely following the 
letter of 
the specification in this test case:

// --
interface I {
        String foo(String [] x, String y);
}
interface J {
        void foo(int x, int y);
}
public class X {
    static void goo(J j) {
        System.out.println("goo(J)");
    }
    static void goo(I i) {
        System.out.println("goo(I)");
    }
    public static void main(String[] args) throws InterruptedException {
                goo((x, y) -> { return x[0] += 1; });
    }
}

But looking at the interfaces involved, I is "obviously" the "right" 
choice and
the call is dismissed as being ambiguous only because the spec says so ?
That is a good enough reason to reject, but just checking.

2. 15.12.2.5 introduces the notation </: - In JLS7 I don't see this symbol 
at
all, nor in the rest of the 335 draft 0.7 (though it is clear what is 
intended)

Thanks in advance for looking into this.
Srikanth.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-spec-experts/attachments/20131126/a918c1fa/attachment.html 


More information about the lambda-spec-experts mailing list