Re: Abstract class with fields implementing ValueObject

2022-03-01 Thread Dan Heidinga
> > My initial reaction was that, no, we really do want IdentityObject here, > because it's useful to be able to assign an abstract class type to > IdentityObject. > > But: for new classes, the compiler will have an opportunity to be explicit. > It's mostly a question of how we handle legacy cla

Re: Abstract class with fields implementing ValueObject

2022-02-24 Thread Dan Smith
TLDR: I'm convinced, let's revise our approach so that the JVM never infers interfaces for abstract classes. On Feb 24, 2022, at 8:57 AM, Dan Heidinga mailto:heidi...@redhat.com>> wrote: Whether they can be instantiated is a decision better left to other parts of the spec (in this case, I belie

Re: Abstract class with fields implementing ValueObject

2022-02-24 Thread Dan Heidinga
On Wed, Feb 23, 2022 at 1:36 PM Dan Smith wrote: > > Fred suggested that we enumerate the whole space here. So, some cases to > consider: > > { ACC_PERMITS_VALUE, not } > { has an declaration, not } > { implements IdentityObject, not } > { implements ValueObject, not } > > "implements" here refe

Re: Abstract class with fields implementing ValueObject

2022-02-23 Thread Dan Smith
Fred suggested that we enumerate the whole space here. So, some cases to consider: { ACC_PERMITS_VALUE, not } { has an declaration, not } { implements IdentityObject, not } { implements ValueObject, not } "implements" here refers to both direct and indirect superinterfaces. I'll focus on the f

Re: Abstract class with fields implementing ValueObject

2022-02-14 Thread Dan Smith
> On Feb 14, 2022, at 7:23 AM, Frederic Parain > wrote: > > > On 2/13/22 1:05 PM, Dan Smith wrote: >>> On Feb 12, 2022, at 10:16 PM, Srikanth Adayapalam >>> wrote: >>> >>> I understand Frederic is asking about whether the spec​ inadvertently >>> allows something it should not - Here anyway

Re: Abstract class with fields implementing ValueObject

2022-02-14 Thread Frederic Parain
On 2/13/22 1:05 PM, Dan Smith wrote: On Feb 12, 2022, at 10:16 PM, Srikanth Adayapalam wrote: I understand Frederic is asking about whether the spec​ inadvertently allows something it should not - Here anyway is javac behavior: Given: abstract class A implements ValueObject { int x;

Re: Abstract class with fields implementing ValueObject

2022-02-13 Thread Dan Smith
> On Feb 12, 2022, at 10:16 PM, Srikanth Adayapalam > wrote: > > I understand Frederic is asking about whether the spec​ inadvertently allows > something it should not - Here anyway is javac behavior: > > Given: > > abstract class A implements ValueObject { > int x; > } > > on compile: >

Re: Abstract class with fields implementing ValueObject

2022-02-13 Thread Srikanth Adayapalam
with fields implementing ValueObject > On Feb 9, 2022, at 2:50 PM, 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_P

Re: Abstract class with fields implementing ValueObject

2022-02-11 Thread Dan Smith
> On Feb 9, 2022, at 2:50 PM, 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 Va

Re: Abstract class with fields implementing ValueObject

2022-02-10 Thread Remi Forax
- Original Message - > From: "John Rose" > To: "Frederic Parain" > Cc: "valhalla-spec-experts" > Sent: Thursday, February 10, 2022 12:02:53 AM > Subject: Re: Abstract class with fields implementing ValueObject > That could be one of ve

Re: Abstract class with fields implementing ValueObject

2022-02-09 Thread John Rose
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 “