Loosening requirements for super() invocation
Brian Goetz
brian.goetz at oracle.com
Tue Jan 24 00:42:10 UTC 2023
Yes, substitute "normal completion" for "exit".
On 1/23/2023 3:39 PM, Robbe Pincket wrote:
>
> Mon Jan 23 20:01:23 UTC 2023, Brian Goetz:
>
> >> * Add the requirement that `super()` and `this()` may not appear
>
> >> within any `try { }` block
>
> >
>
> > if `this` is DA/U on entry to a try block, it must be DA/U on exit from
>
> that try block
>
> Those are only equivalent if there is no return/throw/break/continue/yield
>
> inside the try block.
>
> ```
>
> // `this` is DU and not DA
>
> try {
>
> // `this` is DU and not DA
>
> if (arg1 > 0){
>
> this(arg2);
>
> // `this` is DA and not DU
>
> return;
>
> // `this` is DA and DU
>
> }
>
> // `this` is DU and not DA
>
> }
>
> ```
>
> Kind regards
>
> Robbe Pincket
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230123/cfb4ab67/attachment.htm>
More information about the amber-dev
mailing list