Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/contextReceivers/superClassAndSubClassWithContextReceiver.kt
T
2022-05-13 18:04:02 +00:00

19 lines
277 B
Kotlin
Vendored

// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
class Components(val x: String)
context(Components)
abstract class A {
fun foo(): String = x
}
context(Components)
class B : A()
fun box(): String {
return with(Components("OK")) {
B().foo()
}
}