Part F - Question

Srikanth S Adayapalam srikanth_sankaran at
Wed Nov 27 20:35:52 PST 2013

> 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, 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 ?


 // --
 interface I {
  String foo(String [] x, String y);
 interface J {
  void foo(int x, int y);
 public class X {
     static void goo(J j) {
     static void goo(I i) {
     public static void main(String[] args) throws InterruptedException {
        goo((x, y) -> { return x[0] += 1; });
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the lambda-spec-experts mailing list