Introduce Variable: Allow choosing extraction scope for expressions in the lambda body

#KT-7720 Fixed
This commit is contained in:
Alexey Sedunov
2015-11-13 15:06:34 +03:00
parent 70049171cd
commit 5889971d62
25 changed files with 334 additions and 16 deletions
@@ -0,0 +1,9 @@
class A(val a: Int)
class B(val b: Int)
fun foo(f: A.() -> Int) = A(1).f()
fun bar(f: B.() -> Int) = B(2).f()
fun test() {
foo { bar { a + <selection>b</selection> } }
}