KT-12928: decompose invocation like "a.foo(b)" to "$t = a; $s = $t.foo.bind($t); $s(b)" instead of "$t = a.foo; $t(b)", since in the latter case foo won't receive proper this. Add optimization that replaces "foo.bar.bind(baz)(args)" with "baz.bar(args)"

This commit is contained in:
Alexey Andreev
2016-07-01 12:14:05 +03:00
parent 07cb3e09b9
commit 88eef7337e
11 changed files with 157 additions and 3 deletions
@@ -0,0 +1,8 @@
package foo
fun box(): String {
val v = mapOf(1 to "1", 2 to "2").mapValues { it.value.map { it.toString() } }
assertEquals(2, v.size)
return "OK"
}