Appealing, but it does raise the question of whether, if the programmer uses 
some sneaky trick such as calling super, this can really be enforced ar compile 
time on all cases. If it can (after all), then your proposed wording looks good 
to me. 

—Guy

Sent from my iPhone

> On Apr 29, 2020, at 1:08 PM, Gavin Bierman <[email protected]> wrote:
> 
> Talking it through with Dan, I think the best thing for the JLS is to avoid 
> issues of `this` etc and simply state:
> 
>    It is a compile-time error to assign to the instance fields of the record 
> class in the body of the compact constructor.
> 
> Thoughts?
> Gavin
> 
> 
>> On 27 Apr 2020, at 23:54, Remi Forax <[email protected]> wrote:
>> 
>> 
>> 
>> ----- Mail original -----
>>> De: "Brian Goetz" <[email protected]>
>>> À: "daniel smith" <[email protected]>, "John Rose" 
>>> <[email protected]>
>>> Cc: "amber-spec-experts" <[email protected]>
>>> Envoyé: Mardi 28 Avril 2020 00:37:05
>>> Objet: Re: Possible records tweak
>> 
>>>>> So maybe `super` is DA but `this` is DU, just like in the code
>>>>> before the super-constructor call.  (I’m abusing the terms DA/DU
>>>>> like Brian is, and you call out, but they are close to correct.)
>>>> I think this means I can't call inherited method 'getParentWidget()' or 
>>>> some
>>>> static utility 'computeWidgetOfParent(this)' method (e.g.,
>>>> 'identityHashCode(this)'). I *can* call 'super.getParentWidget()'.
>>> 
>>> Except records only inherit from Record, which has no non-inherited
>>> instance methods.
>> 
>> super.wait(), etc should work
>> 
>> Rémi
>> 
> 

Reply via email to