JEP proposed to target JDK 11: 323: Local-Variable Syntax for Lambda Parameters

Martijn Verburg martijnverburg at gmail.com
Fri Jan 26 08:30:58 UTC 2018


Hi all,

I'm struggling to understand the motivation for this JEP in terms of it
adding improved understanding or readability of source code (as the
implicit case is already covered today).

I also suspect the illegal use uses (extract below) will likely confuse and
frustrate day to day developer's who don't understand the underlying type
inference system and lead to
some heavily upvoted SO Q's.  I liken this type of frustration seen in
developers not understanding generics in full and coming undone in corner
cases where they expect the element of
'least surprise'.

------

The following examples are illegal:

(var x, y) -> x + y        // Cannot mix var and "no var" in
implicitly typed lambda expression
(var x, int y) -> x + y    // Cannot mix var and manifest types in
explicitly typed lambda expression


-------

I'm not sure I've explained myself very eloquently here, hope this has made
some sense.

Cheers,
Martijn

On 26 January 2018 at 08:40, <mark.reinhold at oracle.com> wrote:

> The following JEP is proposed to target JDK 11:
>
>   323: Local-Variable Syntax for Lambda Parameters
>        http://openjdk.java.net/jeps/323
>
> Feedback on this proposal is more than welcome, as are reasoned
> objections.  If no such objections are raised by 23:00 UTC on Thursday,
> 1 February, or if they're raised and then satisfactorily answered, then
> per the JEP 2.0 process proposal [1] I'll target this JEP to JDK 11.
>
> - Mark
>
>
> [1] http://cr.openjdk.java.net/~mr/jep/jep-2.0-02.html
>


More information about the jdk-dev mailing list