Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/contextReceivers/withTwoContextReceivers.kt
T
Ilya Chernikov 141333bdcd K2: Update extension receiver after checking in CheckExtensionReceiver
fixes receiver selection when the candidate has more that one possible
extension receiver
#KT-62129 fixed
2023-09-22 11:33:46 +00:00

13 lines
216 B
Kotlin
Vendored

// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
class A { val o = "O" }
class B { val k = "K" }
val A.bar get() = o
context(A, B)
fun ok() = bar + k
fun box(): String = with(A()) { with(B()) { ok() } }