Files
kotlin-fork/compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiverError.kt
T
2021-12-02 20:24:16 +03:00

20 lines
248 B
Kotlin
Vendored

// !LANGUAGE: +ContextReceivers
class A
class B
class C
context(A)
fun B.f() {}
fun main() {
val b = B()
b.<!NO_CONTEXT_RECEIVER!>f()<!>
with(A()) {
b.f()
}
with(C()) {
b.<!NO_CONTEXT_RECEIVER!>f()<!>
}
}