Sealing itself (preventing extension) is not the issue. But we can’t list the children, which we need for exhaustivity checking.
(If you don’t need/want exhaustivity checking, making the constructor private[pkg] is enough).
Sealing itself (preventing extension) is not the issue. But we can’t list the children, which we need for exhaustivity checking.
(If you don’t need/want exhaustivity checking, making the constructor private[pkg] is enough).