Files
kotlin-fork/analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleMissingCase.kt
T
Marco Pennekamp eabbe21b66 [AA] Add diagnostics tests for sealed classes/interfaces
- 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
2024-01-10 10:13:23 +00:00

11 lines
213 B
Kotlin
Vendored

sealed class MySealedClass
class OneSealedChild : MySealedClass()
class TwoSealedChild : MySealedClass()
fun testSealed(m: MySealedClass): String {
return when (m) {
is OneSealedChild -> "1"
}
}