Spec draft for JEP 286 Local Variable Type Inference
Remi Forax
forax at univ-mlv.fr
Wed Mar 29 23:58:33 UTC 2017
Hi Dan,
Looks great !
In 14.4.1, a minor remark, i had to look for what standalone expression is, not poly expression seems better for me so i suggest that
Because the initializer is a standalone expression, an error occurs if it is a lambda expression (15.27) or a method reference expression (15.13).
can be
Because the initializer is not a poly expression, an error occurs if it is a lambda expression (15.27) or a method reference expression (15.13).
So a var initialized by an anonymous class with diamond is not supported because it's not a poly expression (but its type is denotable) and
an anonymous class with type arguments is not supported because its type is not denotable.
Given that without var, when the type of an anonymous class with a diamond is inferred, the resulting type is the super type,
i think you can relax the current rule to allow var to be initialized with an anonymous class (with no diamond), the resulting type will be the super type.
regards,
Rémi
----- Mail original -----
> De: "Dan Smith" <daniel.smith at oracle.com>
> À: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Jeudi 30 Mars 2017 01:12:53
> Objet: Spec draft for JEP 286 Local Variable Type Inference
> Hello, all. Please see below for a draft spec of language changes to support
> local variable type inference ('var').
>
> If you haven't read it already, you'll want to look at the proposal [1] and
> Brian's summary of design considerations and community feedback (sent to
> platform-jep-discuss) [2].
>
> With that context, here's the spec document:
> http://cr.openjdk.java.net/~dlsmith/local-var-inference.html
>
> I'll follow up with some supplementary background on design considerations,
> beyond what's covered by the platform-jep-discuss email.
>
> Feel free to respond with your feedback.
>
> Thanks,
> Dan
>
> [1]: http://openjdk.java.net/jeps/286
> [2]:
> http://mail.openjdk.java.net/pipermail/platform-jep-discuss/2016-December/000066.html
More information about the amber-spec-experts
mailing list