RFR: 8325805: Compiler Implementation for Flexible Constructor Bodies (Second Preview) [v9]
Jan Lahoda
jlahoda at openjdk.org
Thu May 23 07:22:08 UTC 2024
On Thu, 9 May 2024 13:53:11 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
>> This patch changes the compiler to allow constructors to make assignments to fields prior to the `super()` invocation, i.e., in the pre-construction context. This is part of the work associated with [JDK-8325803 - Flexible Constructor Bodies (Second Preview)](https://bugs.openjdk.org/browse/JDK-8325803).
>>
>> This patch is based the relevant bits from @vicente-romero-oracle's commit [1b99b5cf](https://github.com/openjdk/valhalla/commit/1b99b5cfd9a5d484b9e7bdfc284daad9ad6535bf) to the valhalla repo.
>
> Archie Cobbs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 27 commits:
>
> - Merge branch 'master' into JDK-8325805
> - Update feature name "statements before super()" -> "flexible constructors".
> - Remove redundant type check.
> - Use instanceof instead of hasTag().
> - Refactor some common logic into new method Resolve.isEarlyReference().
> - Minor improvements to method name and Javadoc description.
> - Add assertion to Resolve.resolveSelf() verifying symbol name.
> - Allow declaring and instantiating local classes prior to super().
> - Merge branch 'master' into JDK-8325805
> - Merge branch 'master' into JDK-8325805
> - ... and 17 more: https://git.openjdk.org/jdk/compare/0a4eeeaa...963ca915
Please note that the JEP is not Targeted yet:
https://bugs.openjdk.org/browse/JDK-8325803
We need to wait with the actual integration/sponsorship until the JEP is targeted.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18088#issuecomment-2126400539
More information about the compiler-dev
mailing list