Draft JLS spec for records

Chris Hegarty chris.hegarty at oracle.com
Mon Aug 26 14:03:27 UTC 2019


Gavin,

On 23/08/2019 22:25, Gavin Bierman wrote:
> A draft language spec for records is available at:
> 
> http://cr.openjdk.java.net/~gbierman/8222777/8222777-20190823/specs/records-jls.h

"8.10.4 Record Constructor Declarations

  Every record type R has a canonical constructor. This is a public
  constructor whose formal parameter list is identical to the record
  header of R."

--

So for example, is this considered a canonical constructor?

   record R(int i, int j) {
     public R(int jjj, int iii) {
       this.i = jjj;
       this.j = iii;
     }
   }

Does "formal parameter list" include the component name ( as well as the 
order and type )?

-Chris.


More information about the amber-spec-experts mailing list