[FE] Allow lambda argument cast to contextual functional type

This commit is contained in:
Anastasiya Shadrina
2021-09-08 20:40:14 +07:00
committed by TeamCityServer
parent d8faa9686d
commit 7fce2691e2
9 changed files with 81 additions and 9 deletions
@@ -17,7 +17,7 @@ fun File.open(): InputStream = TODO()
fun withAutoClose(block: context(AutoCloseScope) () -> Unit) {
val scope = AutoCloseScopeImpl() // Not shown here
try {
with(scope) { block() }
with(scope) { block(<!NO_VALUE_FOR_PARAMETER!>)<!> }
} finally {
scope.close()
}
@@ -45,9 +45,26 @@ fun test() {
with(C()) {
with(R()) {
f1(lf1)
f1 { _ ->
r
c
}
f2(lf2)
f2 { _ ->
c
}
f3(lf3)
f3 {
r
c
}
f4(lf4)
f4 {
c
}
}
}
}
@@ -45,9 +45,26 @@ fun test() {
with(C()) {
with(R()) {
f1(lf1)
f1 { _ ->
r
c
}
f2(lf2)
f2 { _ ->
c
}
f3(lf3)
f3 {
r
c
}
f4(lf4)
f4 {
c
}
}
}
}