RFR: JDK-8283416: Update java.lang.invoke.MethodHandle to use sealed classes
David Holmes
david.holmes at oracle.com
Tue Mar 22 13:02:37 UTC 2022
On 22/03/2022 4:56 pm, Rémi Forax wrote:
> On Tue, 22 Mar 2022 04:38:15 GMT, ExE Boss <duke at 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
More information about the core-libs-dev
mailing list