b3820564b0
Behavior differs between JVM and JVM_IR backends here because in JVM, the class descriptor comes from the frontend, and its modality for enum is never final. For JVM IR, the class descriptor is based on IrClass, whose modality is sometimes final for enum, presumably because it's easier for backends (see `ClassGenerator.getEffectiveModality`). #KT-49682
38 lines
520 B
Kotlin
Vendored
38 lines
520 B
Kotlin
Vendored
enum class E {
|
|
X {
|
|
override fun a() {}
|
|
},
|
|
Y {
|
|
override fun a() {}
|
|
};
|
|
|
|
abstract fun a()
|
|
|
|
fun b() {}
|
|
|
|
object Obj
|
|
class NestedClass
|
|
}
|
|
|
|
enum class E2 {
|
|
X("") {
|
|
override fun a() {}
|
|
},
|
|
Y(5) {
|
|
override fun a() {}
|
|
};
|
|
|
|
constructor(n: Int) {}
|
|
constructor(s: String) {}
|
|
|
|
abstract fun a()
|
|
}
|
|
|
|
enum class E3(val a: String) {
|
|
X(""), Y("")
|
|
}
|
|
|
|
enum class E4(val a: String, val b: Int, val c: Long, val d: Boolean) {
|
|
X("", 4, 2L, true)
|
|
}
|