mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Otherwise some tools break (e.g. CheckMethodAdapter in ASM, used in generic signature writer) because they expect class names to be Java identifiers. Some tests fixed, some will be fixed in future commits
22 lines
335 B
Kotlin
22 lines
335 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
|