Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/contextReceivers/kt63430.kt
T
2023-11-13 21:36:22 +00:00

27 lines
366 B
Kotlin
Vendored

// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
abstract class A {
context(C)
fun P.foo(): String = result
}
class B : A() {
val p = P()
context(C)
fun test(): String =
p.run {
foo()
}
}
class P
class C(val result: String)
fun box(): String =
with(C("OK")) {
B().test()
}