scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Fix #23113: Treat private classes as sealed

Open nox213 opened this issue 6 months ago • 2 comments

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.

nox213 avatar May 30 '25 14:05 nox213

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.

sjrd avatar May 30 '25 14:05 sjrd

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?

nox213 avatar May 30 '25 14:05 nox213