JEP 323: Allow
var to be used when declaring the formal parameters of implicitly typed lambda expressions
The syntax of a formal parameter declaration in an implicitly typed lambda expression is not aligned with the syntax of a local variable declaration. See JEP 323 for more discussion.
The parser will allow the formal parameters of an implicitly typed lambda expression to be denoted with
var applied to a formal parameter of an implicitly typed lambda expression will be ignored and the inferred type will be exactly the same as not using
var at all. Like the distinction between implicit and explicit lambdas itself, using this syntax is all-or-nothing; either all parameters must be declared with var, or none.
Proposed changes to the Java Language Specification are attached.