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
262 B
Kotlin
Vendored
12 lines
262 B
Kotlin
Vendored
sealed interface MySealedInterface
|
|
|
|
class OneSealedChild : MySealedInterface
|
|
class TwoSealedChild : MySealedInterface
|
|
|
|
fun testSealed(m: MySealedInterface): String {
|
|
return when (m) {
|
|
is OneSealedChild -> "1"
|
|
is TwoSealedChild -> "2"
|
|
}
|
|
}
|