Files
kotlin-fork/compiler/testData/ir/irText/classes/enum.kt
T
Dmitriy Dolovov 02604060ae IR text tests: Don't dump signatures for local declarations
1. Local declarations don't participate in IR-linkage, because they
can be referenced only inside the same body -> can be dropped
from IR text tests.

2. Mangled names for private declarations computed by descriptors/fir
are actually not used anywhere (they are recomputed by IR
immediately before serialization of IR). But sometimes such
mangled names diverge between K1 and K2 -> don't check them, but
always check mangled names computed by IR even for private
declarations.

3. Also: Drop DUMP_LOCAL_DECLARATION_SIGNATURES test directive.

^KT-57428 Obsolete
^KT-57430 Obsolete
^KT-57434 Obsolete
^KT-57778 Obsolete
^KT-57775 Obsolete
2023-11-30 08:32:35 +00:00

53 lines
893 B
Kotlin
Vendored

// WITH_STDLIB
// IGNORE_BACKEND: JS_IR JS_IR_ES6 NATIVE
// ^ KT-61141: absent enum fake_overrides: finalize (K1), getDeclaringClass (K1), clone (K2)
enum class TestEnum1 {
TEST1, TEST2
}
enum class TestEnum2(val x: Int) {
TEST1(1),
TEST2(2),
TEST3(3) {}
}
enum class TestEnum3 {
TEST {
override fun foo() {
println("Hello, world!")
}
}
;
abstract fun foo()
}
enum class TestEnum4(val x: Int) {
TEST1(1) {
override fun foo() {
println(TEST1)
}
},
TEST2(2) {
val z: Int
init {
z = x
}
override fun foo() {
println(TEST2)
}
}
;
abstract fun foo()
}
enum class TestEnum5(val x: Int = 0) {
TEST1, TEST2(), TEST3(0)
}
fun f(): Int = 1
enum class TestEnum6(val x: Int, val y: Int) {
TEST(y = f(), x = f())
}