RFR: 7903612: Nested struct typedefs fail to compile [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Dec 15 10:57:24 UTC 2023


On Fri, 15 Dec 2023 10:54:59 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> This PR fixes a small issue with nested struct typedef, and another with typedef in general:
>> 
>> * nested struct classes are emitted with the `final` modifier, which prevents them from being subclassed (e.g. in typedefs)
>> * all structs have a private constructor to prevent clients from instantiating. Unfortunately this constructor also prevents subclassing (e.g. in typedef).
>> 
>> This patch drops the `final` modifier on nested struct/unions, and also tweaks the default constructor from `private` to `protected`.
>
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address review comments

src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java line 139:

> 137: 
> 138:     final void emitDefaultConstructor() {
> 139:         appendIndentedLines(STR."""

Since I was here, I decided to fix indentation, as I noticed that this is always off - hopefully that's not disruptive with other ongoing work

-------------

PR Review Comment: https://git.openjdk.org/jextract/pull/164#discussion_r1427839662


More information about the jextract-dev mailing list