bcfafc601e
This change allows to revert adding `WITH_STDLIB` directive to tests which happened at `a9343aeb`. Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
35 lines
586 B
Kotlin
Vendored
35 lines
586 B
Kotlin
Vendored
private var logs = ""
|
|
|
|
enum class Foo(val text: String) {
|
|
FOO("foo"),
|
|
BAR("bar"),
|
|
PING("foo");
|
|
|
|
init {
|
|
logs += "${text}A;"
|
|
}
|
|
|
|
companion object {
|
|
init {
|
|
logs += "StatA;"
|
|
}
|
|
val first = values()[0]
|
|
init {
|
|
logs += "Stat${first.text};"
|
|
}
|
|
}
|
|
|
|
init {
|
|
logs += "${text}B;"
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
Foo.FOO
|
|
|
|
if (Foo.first !== Foo.FOO) return "FAIL 0: ${Foo.first}"
|
|
|
|
if (logs != "fooA;fooB;barA;barB;fooA;fooB;StatA;Statfoo;") return "FAIL 1: ${logs}"
|
|
|
|
return "OK"
|
|
} |