Draft Spec for Second Preview of Flexible Constructor Bodies (JEP 482)

Stephan Herrmann stephan.herrmann at berlin.de
Tue Jun 11 17:11:05 UTC 2024


Am 11.06.24 um 17:57 schrieb Archie Cobbs:
> On Tue, Jun 11, 2024 at 10:35 AM Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com <mailto:maurizio.cimadamore at oracle.com>> wrote:
>     My point is that we'd probably want the two examples above to align, which
>     probably means going with the rules in JEP 482 (or some alternate rules
>     which achieve the same effects).
> 
> I agree.
> 
> -Archie

Can you help me fully appreciate your agreement? Somewhere in the discussion I 
lost track which example was presented to prove which point and what the 
consequences would be.

What I took home so far is:
* javac and ecj both accept some programs that violate JLS version 22
* JEP 482 has a more consistent set of rules than before
* the concept "chain of enclosing instances" can be an illusion
   (but replacing this.this$0 with val$this$0 could pretend it's real)

What I haven't understood:
* did you say implementing JEP 482 will cause code to be rejected that is 
currently accepted?
   - which examples fall in this category?
* some post spoke of tweaking JLS to model what the implemented behavior is.
    - does anyone still think this is what's happening?
    - if so, which rule reflects implementation rather than principle?

thanks,
Stephan


More information about the amber-spec-experts mailing list