Loosening requirements for super() invocation

Robbe Pincket robbepincket at live.be
Mon Jan 23 20:39:02 UTC 2023


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/33d0252e/attachment.htm>


More information about the amber-dev mailing list