c0f81cbc45
Ensure that when .entries is accessed from an inline function body or lambda argument, EntriesMapping are properly generated and used without excessive mappings and duplicated fields #KT-53236
36 lines
479 B
Kotlin
Vendored
36 lines
479 B
Kotlin
Vendored
// TARGET_BACKEND: JVM_IR
|
|
// NO_CHECK_LAMBDA_INLINING
|
|
// WITH_RUNTIME
|
|
|
|
// WITH_STDLIB
|
|
|
|
// MODULE: lib
|
|
// FILE: MyEnum.kt
|
|
|
|
package test
|
|
|
|
enum class X {
|
|
O,
|
|
K
|
|
}
|
|
|
|
inline fun test(block: () -> String): String {
|
|
return block()
|
|
}
|
|
|
|
// MODULE: caller(lib)
|
|
// !LANGUAGE: +EnumEntries
|
|
|
|
// FILE: 2.kt
|
|
|
|
import test.*
|
|
|
|
@OptIn(ExperimentalStdlibApi::class)
|
|
fun box(): String {
|
|
return test {
|
|
X.entries[0].toString()
|
|
} + test {
|
|
X.entries[1].toString()
|
|
}
|
|
}
|