[FE] Make whens on expect sealed classes and enums not exhaustive

This commit is contained in:
Dmitriy Novozhilov
2021-02-24 16:44:48 +03:00
parent 1cf73203c7
commit 4222bb9af2
29 changed files with 768 additions and 11 deletions
@@ -17,6 +17,16 @@ sealed class WhenMissingCase {
override val branchConditionText: String = "else"
}
sealed class ConditionTypeIsExpect(val typeOfDeclaration: String) : WhenMissingCase() {
object SealedClass : ConditionTypeIsExpect("sealed class")
object SealedInterface : ConditionTypeIsExpect("sealed interface")
object Enum : ConditionTypeIsExpect("enum")
override val branchConditionText: String = "else"
override fun toString(): String = "unknown"
}
object NullIsMissing : WhenMissingCase() {
override val branchConditionText: String = "null"
}
@@ -51,4 +61,4 @@ sealed class WhenMissingCase {
override fun toString(): String {
return branchConditionText
}
}
}