Files
kotlin/compiler/testData/codegen/box/sam/constructors/comparator.kt
2019-11-19 11:00:09 +03:00

10 lines
291 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// KJS_WITH_FULL_RUNTIME
fun box(): String {
val list = mutableListOf(3, 2, 4, 8, 1, 5)
val expected = listOf(8, 5, 4, 3, 2, 1)
list.sortWith(Comparator { a, b -> b - a })
return if (list == expected) "OK" else list.toString()
}