[FE] Support context receivers on classes

This commit is contained in:
Anastasiya Shadrina
2020-08-20 14:11:50 +07:00
committed by TeamCityServer
parent c34fe8d547
commit f4ddf66ac4
19 changed files with 232 additions and 5 deletions
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class Outer {
val x: Int = 1
}
context(Outer)
class Inner(arg: Any) {
fun bar() = x
}
fun f(outer: Outer) {
<!NO_CONTEXT_RECEIVER!>Inner(1)<!>
with(outer) {
Inner(3)
}
}