3dd0c9d1c7
Fixed KT-14939: use expected receiver type when generating receiver code in get/set methods for bound property references.
Otherwise we have VerifyError for bound receiver 'null' of type 'Nothing?', which is mapped to 'java.lang.Void'.
TODO: proper equality comparison for property accessors ('x::prop.getter', 'x::prop.setter').
20 lines
353 B
Kotlin
Vendored
20 lines
353 B
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS
|
|
|
|
enum class E {
|
|
A, B;
|
|
|
|
fun foo() = this.name
|
|
}
|
|
|
|
fun box(): String {
|
|
val f = E.A::foo
|
|
val ef = E::foo
|
|
|
|
if (f() != "A") return "Fail 1: ${f()}"
|
|
if (f == E.B::foo) return "Fail 2"
|
|
if (ef != E::foo) return "Fail 3"
|
|
|
|
return "OK"
|
|
}
|