> De: "John Rose" <john.r.r...@oracle.com>
> À: "daniel smith" <daniel.sm...@oracle.com>
> Cc: "amber-spec-experts" <amber-spec-experts@openjdk.java.net>
> Envoyé: Jeudi 10 Juin 2021 00:29:40
> Objet: Re: Experience with sealed classes & the "same package" rule
> (Also on the same hit-list: The restriction against
> using local sealed hierarchies. The restriction
> doesn’t make any sense, logically. And it is a
> sharp edge when you copy-and-paste a hierarchy
> as a unit.)

yes, local sealed hierarchies should be allowed if they are inside the same 
scope, it's infuriating to have to move the hierarchy as members of the class 
when you want to write a unit test with everything confined in the same method. 
The same also goes for annotations which are not allowed to be local likewise 
you can not declare them inside a method of a unit test. 

> — John

Rémi 

Reply via email to