Updated Draft specs for JEP 359 (Records)

Florian Weimer fw at deneb.enyo.de
Mon Nov 4 20:50:09 UTC 2019


* Alex Buckley:

> However, you are right that the spec is slightly misworded. It says "It 
> is a compile-time error if a record declaration contains a canonical 
> constructor declaration that is not public." but a "canonical" ctor is 
> public by definition. It should say "It is a compile-time error if a 
> record declaration contains a constructor declaration whose formal 
> parameter list is identical to the record header of R, but which is not 
> public."

I think we are looking at different versions of the spec.  I don't see
either wording here:

<http://cr.openjdk.java.net/~gbierman/jep359/jep359-20191031/specs/records-jls.html#jls-8.10.4>

But the updated wording works for me.

Also thanks to Brian for explaining the rationale to me.  I agree that
the current behavior is consistent with the kind of restrictions
imposed (or not) by the rest of the language.  The need for defensive
copies is particularly persuasive.


More information about the amber-dev mailing list