mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
The change in DescriptorSerializer is needed so that serialized protos of enum entry classes which are resolved in sources (LazyClassDescriptor) and are deserialized from binaries (EnumEntrySyntheticClassDescriptor) are the same. There are tests on incremental compilation in JS that check that the serialized proto is exactly the same after rebuild and after an incremental build. #KT-22048 Fixed
25 lines
542 B
Kotlin
Vendored
25 lines
542 B
Kotlin
Vendored
// IGNORE_BACKEND: JS_IR, JS, NATIVE
|
|
// WITH_REFLECT
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
enum class TestEnum(val id: String? = null) {
|
|
ENUM1(id = "enum1_id"),
|
|
|
|
ENUM2(id = "enum2_id") {
|
|
override fun test() {
|
|
ENUM1.test()
|
|
}
|
|
};
|
|
|
|
open fun test() {
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
assertEquals(listOf("fun <init>(kotlin.String?): TestEnum"), TestEnum.ENUM1::class.constructors.map { it.toString() })
|
|
assertEquals(listOf(), TestEnum.ENUM2::class.constructors.map { it.toString() })
|
|
|
|
return "OK"
|
|
}
|