[FE] Allow lambda argument cast to contextual functional type
This commit is contained in:
committed by
TeamCityServer
parent
d8faa9686d
commit
7fce2691e2
+1
-1
@@ -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()
|
||||
}
|
||||
|
||||
+17
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user