Implicit constructor of the super class of a null restricted value class

Dan Smith daniel.smith at oracle.com
Sat Oct 21 13:48:31 UTC 2023


On Oct 21, 2023, at 12:27 AM, Remi Forax <forax at univ-mlv.fr> wrote:

In https://bugs.openjdk.org/browse/JDK-8317765,
an implicit constructor must be public and the super class is either Object or a super class with an implicit constructor.

This means that we can NOT create a null restricted value record because the constructor of Record is protected.

I think the constraints on the implicit constructor of the super class should be relaxed. The implicit constructor of the super class does not have to be public.

Sure, we could relax the rule. But why?

Specifically, when it comes to Record, is there any reason the constructor can't be made public?

(My interpretation of the code is that somebody wanted to emphasize that Record is an abstract class by making the constructor protected. But 'abstract' and 'protected' have the same effect here, you don't need them both.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-experts/attachments/20231021/0d437604/attachment.htm>


More information about the valhalla-spec-experts mailing list