[FIR2IR] Create delegated field for delegation to var property

^KT-65920 Fixed
This commit is contained in:
Dmitriy Novozhilov
2024-02-19 14:57:08 +02:00
committed by Space Team
parent 26fae9e83a
commit 3469e3b198
24 changed files with 152 additions and 9 deletions
@@ -0,0 +1,20 @@
// ISSUE: KT-65920
interface I {
fun foo()
}
class Test2(var j: I) : I by j
fun box(): String {
var result = ""
val x = Test2(object : I { override fun foo() { result += "1" }})
x.foo()
x.j = object : I { override fun foo() { result += "2" }}
x.foo()
return when (result) {
"11" -> "OK"
else -> "Fail: $result"
}
}