On 22/03/2022 4:56 pm, Rémi Forax wrote:
On Tue, 22 Mar 2022 04:38:15 GMT, ExE Boss <d...@openjdk.java.net> wrote:

javac should be changed to allow fully qualified access to private inner 
classes in the permits clause of an enclosing class.

This is not how private works, private means accessible between the '{' and the 
'}' of the class.
The permits clause is declared outside of the '{' and the '}' of the class, 
thus a private member class is not visible from the permits clause.

This seems like an oversight in the Sealed classes specification. It makes perfect sense to have a sealed class that can only be extended by its own nested classes, so you should be able to clearly state that.

David
-----

-------------

PR: https://git.openjdk.java.net/jdk/pull/7881

Reply via email to