Introduce parameter: Do not substitute references which don't resolve to parameters or receivers of the target function #KT-7965 Fixed

This commit is contained in:
Alexey Sedunov
2015-06-11 14:41:58 +03:00
parent efb36f4a49
commit 09565c78c5
5 changed files with 53 additions and 6 deletions
@@ -0,0 +1,9 @@
// WITH_RUNTIME
// WITH_DEFAULT_VALUE: false
fun a() {
1.b(2)
}
fun Int.foo(f: Int.(Int) -> Int) = this
fun Int.b(n: Int) = <selection>n.foo { it + this + n + this@b }</selection> + 1
@@ -0,0 +1,9 @@
// WITH_RUNTIME
// WITH_DEFAULT_VALUE: false
fun a() {
1.b(2.foo { it + this + 2 + 1 })
}
fun Int.foo(f: Int.(Int) -> Int) = this
fun Int.b(i: Int) = i + 1