K2: Optimize one-branch when-expr case only for independent context

Using independent one where `when` is nested doesn't look correct
This commit is contained in:
Denis.Zharkov
2022-11-23 14:02:04 +01:00
committed by Space Team
parent 04d3996e68
commit 8f8ea8c57f
7 changed files with 9 additions and 68 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
import java.util.*
import kotlin.comparisons.compareBy
import kotlin.comparisons.nullsLast
@@ -14,4 +15,4 @@ fun getCompInverted(): Comparator<Foo?> =
when {
else -> compareBy({ it.a }, { it.b })
}
)
)