Inline Record vs JLS / Reflection
Remi Forax
forax at univ-mlv.fr
Wed Dec 2 12:09:45 UTC 2020
Hi all,
currently an inline record like this
public @__inline__ record IntBox(int value) {
}
generates two classes, IntBox and IntBox$ref, IntBox being the record itself and IntBox$ref being the abstract class representing the nullable version of an inline that inherits from java.lang.Record.
This doesn't works well with the JLS view / the reflection API because for them a record class is a direct super class of java.lang.Record while in this case java.lang.Record is not a direct super type.
I believe the reflection should be changed to say that a record is a subtype of java.lang.Record.
Rémi
More information about the valhalla-spec-observers
mailing list