Sealed classes -- Feedback on compiler message

Gunnar Morling gunnar at hibernate.org
Sat Jun 6 20:30:20 UTC 2020


Hi all,

I'm playing around a bit with sealed classes. As described in the JEP,
the compiler rejects a subclass in another package when not compiling
a named module. But the compiler error is not clear about the reason:

    class is not allowed to extend sealed class: org.acme.sealed.Shipment

Could it perhaps be a bit more specific, e.g.:

   class is not allowed to extend sealed class in another package when
not compiling a named module: org.acme.sealed.Shipment

Thanks for your consideration,

--Gunnar


More information about the amber-dev mailing list