mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
23 lines
413 B
Kotlin
23 lines
413 B
Kotlin
import kotlin.test.assertEquals
|
|
|
|
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"
|
|
}
|
|
}
|
|
}
|
|
|
|
// 1 LOOKUPSWITCH
|
|
// 1 @_DefaultPackage-functionLiteralInTopLevel-[a-z0-9]+\$WhenMappings.class
|