Spec draft for JEP 286 Local Variable Type Inference
daniel.smith at oracle.com
Thu Mar 30 18:56:58 UTC 2017
> On Mar 30, 2017, at 12:24 PM, forax at univ-mlv.fr wrote:
>> No. There is not a requirement that diamond class instance creation expressions
>> (for anonymous classes or otherwise) be poly expressions. It's perfectly fine
>> to use one of these in a context that has no target type.
> Ok, my bad, an expression can be right hand side context sensitive without being a poly expression.
More accurately (see JLS 15.2), a poly expression is an expression that:
1) Is of an appropriate syntactic form (like a class instance creation expression),
2) Appears in an appropriate context (like an assignment), and
3) Has certain properties, specific to its form, that make it context-sensitive (like using diamond)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the amber-spec-experts