ed6ca7d67e
When replacing an enum entry reference with `this`, you need to take `this` from the function's `dispatchReceiverParameter`, not the class's `thisReceiver`. Otherwise the code generator fails to find the reference among accessible variables.
13 lines
220 B
Kotlin
Vendored
13 lines
220 B
Kotlin
Vendored
enum class Enum {
|
|
ENUM_VALUE {
|
|
override fun test() = ENUM_VALUE
|
|
};
|
|
|
|
abstract fun test(): Enum
|
|
}
|
|
|
|
fun box(): String {
|
|
if (Enum.ENUM_VALUE.test() != Enum.ENUM_VALUE) return "fail"
|
|
return "OK"
|
|
}
|