Files
kotlin-fork/compiler/testData/ir/irText/declarations/contextReceivers/localDeclaration.kt
T
Anastasiya Shadrina 3f50b675b1 [Tests] Add irText tests
2021-12-02 20:24:25 +03:00

29 lines
382 B
Kotlin
Vendored

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