[FIR2IR] Create delegated field for delegation to var property
^KT-65920 Fixed
This commit is contained in:
committed by
Space Team
parent
26fae9e83a
commit
3469e3b198
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user