mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
17 lines
313 B
Kotlin
Vendored
17 lines
313 B
Kotlin
Vendored
// "Create header class implementation for platform JS" "true"
|
|
|
|
header enum class <caret>MyEnum {
|
|
FIRST,
|
|
SECOND,
|
|
LAST;
|
|
|
|
val num: Int
|
|
|
|
companion object {
|
|
fun byNum(num: Int): MyEnum = when (num) {
|
|
1 -> FIRST
|
|
2 -> SECOND
|
|
else -> LAST
|
|
}
|
|
}
|
|
} |