Presently, we have a completely separate pass and algorithms to detect the permitted subtypes of a sealed type when the declaration lacks a permits clause. This is unnecessary. While wiring super types and superinterfaces, we can also discover the implicit subtypes of sealed types.
For example given:
sealed class X {}
final class Y extends X {}
when discovering that Y's super class is X, we can check if X is sealed; if so, whether it lacks a permits clause; if so add Y add a permitted subtype of X;
Presently, we have a completely separate pass and algorithms to detect the permitted subtypes of a sealed type when the declaration lacks a permits clause. This is unnecessary. While wiring super types and superinterfaces, we can also discover the implicit subtypes of sealed types.
For example given:
sealed class X {} final class Y extends X {}
when discovering that Y's super class is X, we can check if
X
is sealed; if so, whether it lacks a permits clause; if so add Y add a permitted subtype of X;