mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Normally, the fact that is was Unit was not visible as enum constructors are lowered to normal class constructors anyway. The exception is when the arguments are reordered, causing the incorrect return type to leak into the block that holds temporary variables.
11 lines
203 B
Kotlin
Vendored
11 lines
203 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// IGNORE_BACKEND: JS
|
|
fun f(): String = "O"
|
|
fun g(): String = "K"
|
|
|
|
enum class E(val x: String, val y: String) {
|
|
A(y = g(), x = f())
|
|
}
|
|
|
|
fun box(): String = E.A.x + E.A.y
|