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
18 lines
338 B
Kotlin
Vendored
18 lines
338 B
Kotlin
Vendored
// IGNORE_FE10
|
|
|
|
// MODULE: lib
|
|
// MODULE_KIND: LibraryBinary
|
|
// FILE: MySealedClass.kt
|
|
sealed class MySealedClass
|
|
|
|
class OneSealedChild : MySealedClass()
|
|
class TwoSealedChild : MySealedClass()
|
|
|
|
// MODULE: main(lib)
|
|
// FILE: main.kt
|
|
fun testSealed(m: MySealedClass): String {
|
|
return when (m) {
|
|
is OneSealedChild -> "1"
|
|
}
|
|
}
|