11 lines
162 B
Kotlin
Vendored
11 lines
162 B
Kotlin
Vendored
enum class MyEnum {
|
|
A, B, C
|
|
}
|
|
|
|
fun foo(x: MyEnum): Int {
|
|
return when (x) {
|
|
MyEnum.A -> 1
|
|
is MyEnum.B -> 2
|
|
is MyEnum.C -> 3
|
|
}
|
|
} |