mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
21 lines
384 B
Kotlin
Vendored
21 lines
384 B
Kotlin
Vendored
// CHECK_CASES_COUNT: function=box$lambda count=0
|
|
// CHECK_IF_COUNT: function=box$lambda count=1
|
|
|
|
enum class Season {
|
|
WINTER,
|
|
SPRING,
|
|
SUMMER,
|
|
AUTUMN
|
|
}
|
|
|
|
fun foo(x : Season, block : (Season) -> String) = block(x)
|
|
|
|
fun box() : String {
|
|
return foo(Season.SPRING) {
|
|
x -> when (x) {
|
|
Season.SPRING -> "OK"
|
|
else -> "fail"
|
|
}
|
|
}
|
|
}
|