-
Sub-task
-
Resolution: Fixed
-
P4
-
8
As part of JEP 213, we'd like to relax the restriction that "If the class instance creation expression ends in a class body ... [and] TypeArgumentsOrDiamond is present after the Identifier, and denotes <>, then a compile-time error occurs."
Instead, this should be allowed in general, but we must check after inference that the inferred type arguments can be expressed in the generated class file's Signature attribute. (I.e., no capture variables, no intersections, etc.)
Instead, this should be allowed in general, but we must check after inference that the inferred type arguments can be expressed in the generated class file's Signature attribute. (I.e., no capture variables, no intersections, etc.)
- relates to
-
JDK-8075896 18: Generalize capture ivars to support diamond anonymous classes
-
- Open
-
-
JDK-8133936 The return type of instance creation expression with diamond and class body should be anonymous class type
-
- Closed
-
-
JDK-8132535 Compiler fails with diamond anonymous class creation with intersection bound of enclosing class
-
- Closed
-
-
JDK-8061650 15.12.2.5: Most specific for generic class constructors different than treatment of methods
-
- Open
-