Possible records tweak
Dan Smith
daniel.smith at oracle.com
Fri Apr 24 19:43:48 UTC 2020
> On Apr 24, 2020, at 1:32 PM, Remi Forax <forax at univ-mlv.fr> wrote:
>
>> (Which, in hindsight, might have been a good rule for _all_ constructors, if there was another way to initialize the fields. Surely would have eliminated much verifier complexity.)
>>
> accessing to the identity hashcode or the current class inside a constructor is valid (i believe) but those are a corner cases.
>
Ah, yes. This generalizes to calling methods that safely operate on an already-initialized superclass (typically instance methods of the superclass).
If we someday have abstract records or other forms of user-defined superclasses, it will be quite reasonable to call the superclass's instance methods from the subclass's constructor.
More information about the amber-spec-experts
mailing list