Draft JLS spec for records
brian.goetz at oracle.com
Mon Aug 26 15:26:54 UTC 2019
>> Does "formal parameter list" include the component name ( as well as the order and type )?
> yes the canonical constructor has to match on component names too,
I suspect this is one of the areas where the implementation and the spec don’t yet agree, so it is a good chance to discuss which should win :)
Requiring the name match is pedantic but underscores the fact that the canonical ctor is about initializing the fields. I think its a reasonable restriction (one we can always lift later), but its also OK to not require it.
Also, I’d like to say something about how the canonical ctor will have its parameter names reified always.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the amber-spec-experts