super constructor of abstract value classes
Daniel Schmid
daniel at wwwmaster.at
Tue Aug 22 08:57:30 UTC 2023
Hi,
When reading the recent article that explains how Q-descriptors and
v-bytecodes are not needed
(https://cr.openjdk.org/~jrose/values/larval-values.html), I came across
> To avoid such ambiguities, we forbid calling the superclass <init>
method.
This seems like a pretty strong restriction though I understand why it's
in place.
Nevertheless, it raises a question when I am reading this:
If it is possible to create abstract value classes (i.e. abstract
classes where all subclasses are value classes), is this restriction
really necessary for that case?
Since the superclass would "know" its subclasses are value classes,
can't the object be copied, modified in the super constructor (the one
of the abstract value class) before all fields are copied back when
continuing with the constructor of the concrete value class?
Or are there just no "abstract value classes" or do you want to keep the
same restrictions on all kind of abstract classes for consistency?
Yours,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4490 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://mail.openjdk.org/pipermail/valhalla-dev/attachments/20230822/6179e7d0/smime.p7s>
More information about the valhalla-dev
mailing list