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

30 lines
430 B
Kotlin
Vendored

// !LANGUAGE: +ContextReceivers
interface A {
fun f() {}
}
class B : A
fun testLocalFunction() {
context(A)
fun local() {
<!UNRESOLVED_REFERENCE!>f<!>()
}
with(B()) {
local()
}
local()
}
fun testLocalClass() {
context(A)
class Local {
fun local() {
<!UNRESOLVED_REFERENCE!>f<!>()
}
}
with(B()) {
Local().local()
}
Local()
}