Varargs, method reference and SAM conversion

Rémi Forax forax at univ-mlv.fr
Tue Jan 11 07:28:35 PST 2011


  Le 11/01/2011 14:01, Collin Fagan a écrit :
> Hi Remi,
>
> Just to clarify, you would like varargs paramaters to be .. um, 
> "flattened" (unwound? de-vared?) when checking for compatible method 
> signatures during method reference assignment?

yes.

>
> That sounds cool, would you think a method that has a vararg should 
> also compatible with methods that take none of the vararg type?
>
> interface PrintOneString {
>   void printOneString(String value);
> }
> PrintTwoStrings  pts = System.out#printf;
> pts.printOneString("value");

Yes, I don't think there is a problem here.

>
> Collin

Rémi


More information about the lambda-dev mailing list