RFR: 7903612: Nested struct typedefs fail to compile [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Dec 15 10:54:09 UTC 2023
On Fri, 15 Dec 2023 10:34:21 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> We also don't generate a private constructor for top-level struct classes, but, if we make the constructor `protected` we could generate them there as well. Same for the header classes I think.
>
> If we stick with these constructors, I think it would also be better to make them package-private. That would mean that someone couldn't extend one of these classes from outside of the package (since there's no way to call the super constructor). A practical replacement for the class being `final`.
>
> Alternatively, we could just not have any explicit constructors/final classes. Since all the methods we generate are `static`, there's probably not that much utility to them. Though, I suppose someone might get confused trying to instantiate one of these classes...
True - package-private is better. I don't think these constructors are necessarily worth it, but for now I just wanted to fix the generated code, we can discuss whether to remove them later.
-------------
PR Comment: https://git.openjdk.org/jextract/pull/164#issuecomment-1857676063
More information about the jextract-dev
mailing list