Files
Andrey Cherkasov fe5183a84e [kotlin] Port ConfusingExpressionInWhenBranchFix to K2
^KTIJ-29486

GitOrigin-RevId: e9643fd3909d395cfc4850bfeb5961854d102e0f
2024-09-07 23:54:36 +00:00

13 lines
535 B
Plaintext

// "Wrap expression in parentheses" "true"
// ERROR: 'when' expression must be exhaustive, add necessary 'true', 'false' branches or 'else' branch instead
interface A {
operator fun contains(other: A): Boolean
}
fun test(x: A, b: Boolean) {
when (b) {
(x in x) -> {}
}
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConfusingExpressionInWhenBranchFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.k2.codeinsight.fixes.ConfusingBranchConditionErrorFixFactories$WrapExpressionInParenthesesFixFactory