Local Variable Type Inference - prototype

Remi Forax forax at univ-mlv.fr
Fri Mar 11 07:59:35 UTC 2016

Hi Maurizio, hi all,
currently, this compiles

public class VarTest {
  var x = 3;
  static final var FOO = 3;

while i don't care too much about being able to declare final static field with var,
being able to declare instance field with var is plainly wrong for me
(and out of the scope of this JEP).


----- Mail original -----
> De: "Maurizio Cimadamore" <maurizio.cimadamore at oracle.com>
> À: platform-jep-discuss at openjdk.java.net
> Envoyé: Jeudi 10 Mars 2016 15:48:25
> Objet: Local Variable Type Inference - prototype
> Hi,
> I've pushed the first iteration of the local variable type inference
> prototype in the sandbox repository[1]. For those willing and brave
> enough to experiment, the branch name is "JEP-286-branch". We are also
> working to get some ready-made binary snapshots out of the door and hope
> to have an update on that soon.
> This first iteration supports the 'var-only' syntax style:
> var s = "Hello!";
> That is, the type of 's' is inferred from the initializer, and no
> special assumption is made about mutability.
> Please share your experience with the prototype. For comments on this
> feature please refer to the survey[2] that Brian posted few days ago.
> Maurizio
> [1] - http://cr.openjdk.java.net/~chegar/docs/sandbox.html
> [2] -
> http://mail.openjdk.java.net/pipermail/platform-jep-discuss/2016-March/000037.html

More information about the platform-jep-discuss mailing list