Skip to content

Conversation

@pkoenig10
Copy link
Member

There is no need to use a permits clause for direct subclasses in the same compilation unit. These subclasses are always permitted.

https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.1.6

@mpritham
Copy link
Contributor

mpritham commented Dec 2, 2025

We had decided to keep the permits clauses, despite not being necessary, to serve as documentation: when a dev navigates to the definition of a union in their IDE, they can see all of the unions variants at a glance without having to read through the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants