[Resend] Draft Spec for Statements before Super() (JEP 447)

Alex Buckley alex.buckley at oracle.com
Thu May 18 19:33:32 UTC 2023


On 5/12/2023 2:08 AM, Gavin Bierman wrote:
> The latest draft of the spec change document for JEP 447 (Statements 
> before super()) is available at:
> 
> https://cr.openjdk.org/~gbierman/jep447/latest/ 

 From thinking about telescoping constructors in another mail, I think 
there's an omission in the draft. In the JEP,

https://openjdk.org/jeps/447#Records

says

"The net result is that non-canonical record constructors may now 
contain prologue statements before this()."

However, the draft does not address how JLS20, at

https://docs.oracle.com/javase/specs/jls/se20/html/jls-8.html#jls-8.10.4-500

says

"A record declaration may contain declarations of constructors that are 
not canonical constructors. The body of every non-canonical constructor 
in a record declaration must *start with* an alternate constructor 
invocation (§8.8.7.1), or a compile-time error occurs."

I assume the intent is to allow a non-canonical ctor in a record 
declaration to *contain* an alternate ctor invocation, not just *start 
with*? If so, please amend 8.10.4 in the draft.

Alex


More information about the amber-spec-experts mailing list