[External] : Re: Possible refinement for sealed classes
forax at univ-mlv.fr
forax at univ-mlv.fr
Thu Apr 1 21:11:48 UTC 2021
----- Mail original -----
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Jeudi 1 Avril 2021 22:32:23
> Objet: Re: [External] : Re: Possible refinement for sealed classes
>> By example, a type WithCheese may make little sense.
>> Anyway, if WithCheese only makes sense for a Sandwich, nesting
>> WithCheese inside Sandwich is the way to go.
>
> This doesn't help unless the *whole* hierarchy is nested in the same
> file. Otherwise you have to have an explicit permits clause on each of
> Sandwich, WIthCheese, etc.
The whole public hierarchy, you can still have an interface inside the compilation unit and a non visible implementation in another file.
Rémi
More information about the amber-spec-experts
mailing list