Semantics of an empty PermittedSubtypes attribute for the VM

forax at forax at
Thu Apr 2 19:37:43 UTC 2020

----- Mail original -----
> De: "Brian Goetz" <brian.goetz at>
> À: "Remi Forax" <forax at>
> Cc: "amber-spec-experts" <amber-spec-experts at>
> Envoyé: Jeudi 2 Avril 2020 16:19:15
> Objet: Re: Semantics of an empty PermittedSubtypes attribute for the VM

> At the language level, we won’t let you define a class with an empty set of
> permitted types; you should define a final class instead.
> But, having the VM treat an empty PS attribute as if it were not there seems
> wrong; I would think an empty PS attribute would be a class file error.

For comparison, i believe the VM also allows attribute NestMembers or BootstrapMethods to be empty.


>> On Apr 2, 2020, at 7:58 AM, Remi Forax <forax at> wrote:
>> Hi all,
>> With my ASM hat,
>> from the JVMS POV, javac can not generate an empty list of permitted subtypes
>> and the implementation in Hotspot ignores the attribute PermittedSubtypes if
>> there is no subtype listed.
>> So currently, ASM doesn't allow you to create an attribute PermittedSubtypes
>> with an empty number of subtypes.
>> I believe this is the correct semantics, i just want to be sure that i've not
>> overlook something.
>> regards,
>> Rémi

More information about the amber-spec-experts mailing list