2187a77646
#KT-14245 In Progress
24 lines
366 B
Plaintext
Vendored
24 lines
366 B
Plaintext
Vendored
// WITH_RUNTIME
|
|
|
|
sealed class <caret>MyEnum(val s: String = "") {
|
|
|
|
fun foo() {
|
|
|
|
}
|
|
|
|
object FOO : MyEnum("FOO")
|
|
object BAR : MyEnum("BAR")
|
|
object DEFAULT : MyEnum()
|
|
}
|
|
|
|
fun test(e: MyEnum) {
|
|
if (e == MyEnum.BAR) {
|
|
println()
|
|
}
|
|
|
|
val n = when (e) {
|
|
MyEnum.BAR -> 1
|
|
MyEnum.FOO -> 2
|
|
MyEnum.DEFAULT -> 0
|
|
}
|
|
} |