scala3
scala3 copied to clipboard
Fix #23113: Treat private classes as sealed
closes: #23113 Currently, child annotations are only attached when the parent class is sealed. This PR extends that behavior to include private classes as well.
That does not seem right to me. Being private certainly implies being effectively sealed. But full sealed is an intentional decision that impacts pattern match exhaustivity checking. There is no spec basis to make that inference, AFAICT.
https://github.com/scala/scala3/pull/14599 Wasn’t this PR about porting the Scala 2 behavior where private classes are treated like sealed ones for exhaustivity checks in pattern matching?