Tracking inflow of lambda receiver

This commit is contained in:
Valentin Kipyatkov
2020-04-11 11:55:46 +03:00
parent 61d4383cb9
commit 7bcd6619cf
10 changed files with 63 additions and 18 deletions
+11
View File
@@ -0,0 +1,11 @@
// FLOW: IN
fun foo() {
with("A") {
val <caret>v = this
}
}
inline fun <T, R> with(receiver: T, block: T.() -> R): R {
return receiver.block()
}
@@ -0,0 +1,8 @@
4 with(<bold>"A"</bold>) {
5 val <bold>v = this</bold>
5 val v = <bold>this</bold>
4 [LAMBDA OUT] with("A") <bold>{</bold>
9 [LAMBDA OUT] inline fun <T, R> with(receiver: T, <bold>block: T.() -> R</bold>): R {
10 return <bold>receiver</bold>.block()
9 inline fun <T, R> with(<bold>receiver: T</bold>, block: T.() -> R): R {
4 with(<bold>"A"</bold>) {
@@ -0,0 +1,3 @@
[NotNull Values]
5 val <bold>v = this</bold>
5 val <bold>v = this</bold>
@@ -0,0 +1,7 @@
5 val <bold>v = this</bold>
5 val v = <bold>this</bold>
4 [LAMBDA OUT] with("A") <bold>{</bold>
9 [LAMBDA OUT] inline fun <T, R> with(receiver: T, <bold>block: T.() -> R</bold>): R {
10 return <bold>receiver</bold>.block()
9 inline fun <T, R> with(<bold>receiver: T</bold>, block: T.() -> R): R {
4 with(<bold>"A"</bold>) {