----- Original Message ----- > From: "John Rose" <john.r.r...@oracle.com> > To: "Frederic Parain" <frederic.par...@oracle.com> > Cc: "valhalla-spec-experts" <valhalla-spec-experts@openjdk.java.net> > Sent: Thursday, February 10, 2022 12:02:53 AM > Subject: Re: Abstract class with fields implementing ValueObject
> That could be one of very many edge conditions in the JVMS that are not > diagnosed directly by a validation, but that will eventually cause an error > when the broken classfile is further used. > > I don’t think there needs to be a special rule for this. We don’t try to > comprehensively diagnose all “impossible-to-use” classfiles. or better we ditch ValueObject and IdentityObject ... Rémi > > On 9 Feb 2022, at 13:50, Frederic Parain wrote: > >> There's a weird case that seems to be allowed by the Value Objects JVMS >> draft: >> >> An abstract class can declare non-static fields, which means it won't >> have the ACC_PERMITS_VALUE flag set, but also declare that it implements >> the ValueObject interface. >> >> The combination looks just wrong, because no class can subclass such class: >> - identity classes are not allowed because of the presence of >> the ValueObject interface >> - value classes are not allowed because of the absence of >> ACC_PERMITS_VALUE >> >> I've looked for a rule that would prohibit such combination in the >> JVMS draft but couldn't find one. >> >> Did I miss something? >> > > Fred