[FE] Support local contextual declarations

This commit is contained in:
Anastasiya Shadrina
2021-04-12 14:26:50 +07:00
committed by TeamCityServer
parent 43d11c7c4b
commit 875f4ea31c
10 changed files with 117 additions and 1 deletions
@@ -0,0 +1,28 @@
interface A {
fun f() {}
}
class B : A
fun testLocalFunction() {
context(A)
fun local() {
f()
}
with(B()) {
local()
}
<!NO_CONTEXT_RECEIVER!>local()<!>
}
fun testLocalClass() {
context(A)
class Local {
fun local() {
f()
}
}
with(B()) {
Local().local()
}
<!NO_CONTEXT_RECEIVER!>Local()<!>
}