Loosening requirements for super() invocation

Brian Goetz brian.goetz at oracle.com
Tue Jan 24 20:21:01 UTC 2023



> This made me realize there is another missing requirement:
>
>   * Upon normal return from a constructor, the `this` reference must
>     be DA
>

So, I think this is true by definition; on normal return from a 
super/this/implicit super call, then `this` *is* DA.

You can simplify the rule about try blocks to:

  - if `this` is DU on entry to a try block, it must be DU on normal 
completion of the try block.

Can you simplify further, while still preventing `this` calls inside a 
try block?  I don't think so, since we might want to allow a try block 
before the super/this call.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230124/de18480d/attachment-0001.htm>


More information about the amber-dev mailing list