[FE] Support local contextual declarations
This commit is contained in:
committed by
TeamCityServer
parent
43d11c7c4b
commit
875f4ea31c
+28
@@ -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()<!>
|
||||
}
|
||||
Reference in New Issue
Block a user