Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/contextReceivers/simpleCall.kt
T
2022-04-06 16:05:39 +00:00

22 lines
277 B
Kotlin
Vendored

// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
class A {
val o = "O"
}
class B {
val k = "K"
}
context(B) fun A.f(a: Any, b: Any) = o + k
fun B.g(a: A): String {
with (a) {
return f(1, "2")
}
}
fun box(): String {
return B().g(A())
}