mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
18 lines
250 B
Kotlin
Vendored
18 lines
250 B
Kotlin
Vendored
// CHECK_CASES_COUNT: function=test count=0
|
|
// CHECK_IF_COUNT: function=test count=3
|
|
|
|
enum class E {
|
|
A,
|
|
B
|
|
}
|
|
|
|
fun test(e: E?) = when (e) {
|
|
E.A -> "Fail A"
|
|
null -> "OK"
|
|
E.B -> "Fail B"
|
|
}
|
|
|
|
fun box(): String {
|
|
return test(null)
|
|
}
|