[FIR] Fix generating this reference in delegated accessors

There was a problem with delegated extension property with dispatch
  receiver that `this` in `getValue` call was set to dispatch receiver
  instead of extension one
This commit is contained in:
Dmitriy Novozhilov
2021-02-20 15:26:01 +03:00
committed by TeamCityServer
parent 4e5647090e
commit ea2783eace
9 changed files with 15 additions and 159 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.reflect.KProperty
class Delegate {
@@ -1,6 +1,5 @@
// !LANGUAGE: -NewInference
// IGNORE_BACKEND_FIR: JVM_IR
inline operator fun Double.provideDelegate(thisRef: Any?, kProp: Any?) = this.toLong()
inline operator fun Long.getValue(thisRef: Any?, kProp: Any?) = this.toInt()
@@ -59,4 +58,4 @@ fun box(): String {
x.test(intArray)
return "OK"
}
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
object Host {
@@ -13,4 +12,4 @@ object Host {
val ok = "O".plusK
}
fun box(): String = Host.ok
fun box(): String = Host.ok
@@ -1,6 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: NATIVE
//For KT-6020
@@ -59,4 +58,4 @@ fun box(): String {
val p = Value("O", CR("K"))
val rr = p.additionalText
return rr.p1 + rr.p2
}
}