> On Mar 30, 2017, at 12:24 PM, [email protected] 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)

—Dan

Reply via email to