mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 08:31:30 +00:00
Introduce MetadataSource as a way to store the original descriptor for any element (before any lowerings) and maintain it until the end of the codegen where it's used in generating the metadata. Note that JVM signatures written to the metadata are formed from the _resulting_ generated elements, not by mapping the original descriptors. Some corner cases are not supported yet, namely properties declared in companion objects, synthetic methods for property annotations, JvmPackageName, etc. #KT-29119 Fixed
26 lines
560 B
Kotlin
Vendored
26 lines
560 B
Kotlin
Vendored
// IGNORE_BACKEND: JS_IR, JS, NATIVE
|
|
// WITH_REFLECT
|
|
package test
|
|
|
|
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?): test.TestEnum"), TestEnum.ENUM1::class.constructors.map { it.toString() })
|
|
assertEquals(listOf(), TestEnum.ENUM2::class.constructors.map { it.toString() })
|
|
|
|
return "OK"
|
|
}
|