Experience with sealed classes & the "same package" rule

John Rose john.r.rose at oracle.com
Wed Jun 23 02:35:06 UTC 2021

On Jun 22, 2021, at 2:08 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> The proposed simplification allows different packages to share different part of the sealed hierarchy without a module.
> So those packages can be in different jars, compiled at different times.
> This will produce "impossible" sealed hierarchies where by example two types are both permitted subtypes of each other.
> We can save a lot of test and debugging time to a lot of people by avoiding split sealed hierarchy.

Nah.  The JVM (and probably javac) has to check
for broken inputs always, regardless of how
likely those broken inputs might be.

More information about the amber-spec-experts mailing list