Part F - Question
Dan Smith
daniel.smith at oracle.com
Fri Dec 6 09:25:27 PST 2013
Yes, there's a spec/implementation discrepancy right now. We're discussing internally how we'd like to handle this. (Any comments here are welcome, too, of course.)
—Dan
On Nov 27, 2013, at 9:35 PM, Srikanth S Adayapalam <srikanth_sankaran at in.ibm.com> wrote:
> > From: Srikanth S Adayapalam/India/IBM
> > Subject: Part F - Question
> >
> > 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:
>
> Actually, I think I am mistaken and this looks like a bug in javac 8b115.
> (My earlier mail mistakenly mentioned 8b116 - I tested only with 8b115)
> Per 15.12.2.1, goo(J) is not a potentially applicable method to the method
> invocation given J's function type requires a void return and the argument
> lambda expression is not void compatible.
>
> Dan &| Maurizio, could you confirm this is a bug in the RI or if I have
> overlooked something ?
>
> Thanks!
> Srikanth
>
>
> // --
> 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; });
> }
> }
>
More information about the lambda-spec-experts
mailing list