eabbe21b66
- KT-62895 cannot be reproduced on the Analysis API side. Still, it is useful to add tests here for better coverage in the future. - The reason is likely that Analysis API tests specifically use `SealedClassesInheritorsCaclulatorPreAnalysisHandler` to compute sealed class inheritors (which are usually the breaking point for problems in `when` exhaustiveness checking), so the tests do not use the production implementation. See KT-64505 for future work on this problem. ^KT-62895
12 lines
246 B
Kotlin
Vendored
12 lines
246 B
Kotlin
Vendored
sealed class MySealedClass
|
|
|
|
class OneSealedChild : MySealedClass()
|
|
class TwoSealedChild : MySealedClass()
|
|
|
|
fun testSealed(m: MySealedClass): String {
|
|
return when (m) {
|
|
is OneSealedChild -> "1"
|
|
is TwoSealedChild -> "2"
|
|
}
|
|
}
|