Files
kotlin-fork/compiler/visualizer/testData/uncommonCases/testFiles/where.kt
T
Ivan Cilcic aebe8c36f5 Add test methods and data for uncommon cases
Uncommon means mostly that aren't present in raw fir builder data
2019-08-30 11:50:31 +03:00

10 lines
293 B
Kotlin
Vendored

fun <T> copyWhenGreater(list: List<T>, threshold: T): List<String>
where T : CharSequence,
T : Comparable<T> {
return list.filter { it > threshold }.map { it.toString() }
}
fun main() {
val list = listOf("1", "2", "3")
val copy = copyWhenGreater(list, "2")
}