[FE] Make whens on expect sealed classes and enums not exhaustive
This commit is contained in:
@@ -90,8 +90,10 @@ class AddWhenRemainingBranchesFix(
|
||||
(whenCloseBrace.prevSibling as? PsiWhiteSpace)?.replace(psiFactory.createNewLine())
|
||||
for (case in missingCases) {
|
||||
val branchConditionText = when (case) {
|
||||
WhenMissingCase.Unknown, WhenMissingCase.NullIsMissing, is WhenMissingCase.BooleanIsMissing ->
|
||||
case.branchConditionText
|
||||
WhenMissingCase.Unknown,
|
||||
WhenMissingCase.NullIsMissing,
|
||||
is WhenMissingCase.BooleanIsMissing,
|
||||
is WhenMissingCase.ConditionTypeIsExpect -> case.branchConditionText
|
||||
is WhenMissingCase.IsTypeCheckIsMissing ->
|
||||
if (case.isSingleton) {
|
||||
""
|
||||
@@ -126,4 +128,4 @@ class AddWhenRemainingBranchesFix(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ expect sealed class <!LINE_MARKER("descr='Is subclassed by CommonAImplTestClass
|
||||
class CommonImplTestClass: TestClass()
|
||||
|
||||
|
||||
fun checkCommon(t: TestClass): Int = when (t) {
|
||||
fun checkCommon(t: TestClass): Int = <!EXPECT_TYPE_IN_WHEN_WITHOUT_ELSE, NO_ELSE_IN_WHEN!>when<!> (t) {
|
||||
is CommonImplTestClass -> 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user