Are there any plans to support module-wide sealed classes?
k
Are there any plans to support module-wide sealed classes?
👍 1
m
I guess these are still restricted to same package.
so maybe not what you wanted
k
yup, package-wide works great, it's a welcome addition in some cases but module wide would come in handy sometimes too, or maybe like Java does it, with specifying all the sub classes..
d
What is your usecase for module-wide sealed inheritors?
or maybe like Java does it, with specifying all the sub classes
This never happens because of at least two reasons: - too much useless verbosity -
expect sealed
classes can't work in such scheme, because it's allowed to add new inheritors only for
actual sealed
class
k
it was mostly a very large class hierarchy with lots of code in each class... having everything in one package is definitely doable, but it would be maybe a bit better to be able to organise it in a package hierarchy being able to have sealed classes in separate files does the job in 99% of the cases...
2