8f8ea8c57f
Using independent one where `when` is nested doesn't look correct
19 lines
438 B
Kotlin
Vendored
19 lines
438 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
import java.util.*
|
|
import kotlin.comparisons.compareBy
|
|
import kotlin.comparisons.nullsLast
|
|
|
|
class Foo(val a: String, val b: Int)
|
|
|
|
fun getComp(): Comparator<Foo?> =
|
|
when {
|
|
else -> nullsLast(compareBy({ it.a }, { it.b }))
|
|
}
|
|
|
|
fun getCompInverted(): Comparator<Foo?> =
|
|
nullsLast(
|
|
when {
|
|
else -> compareBy({ it.a }, { it.b })
|
|
}
|
|
)
|