Expand what permit can specify in Sealed Classes

Suminda Sirinath Salpitikorala Dharmasena sirinath1978m at gmail.com
Wed Nov 11 07:17:22 UTC 2020


Hello,

Can the scope of the permit be expanded so following use cases are
supported:

   - package - permits package x.y.x, package a.b.c, S, T (S, T are classes
   or interfaces)
   - modules - permits module x.y.x, module a.b.c, S, T
   - subtypes - permits extend A, extend B, S, T
   - supertypes - permits super A, super B, S, T
   - subtypes of supertype - permits extend super A, extend super B
   (effectively not a subtype of A or B. Combining with extends can limit the
   type hierarchy - e.g.: permits extends A, extends super B)
   - class or interface - permits S, T (current implementation and
   functionality)

Suminda


More information about the amber-dev mailing list