8ad339836d
```
function foo (closureParam, closureParam2, ...) {
return function() {
// function body
}
}
```
from FunctionContext to FunctionInlineMutator. The old code causes bug when calling this function like this: `foo(this, ...)`, since first `closureParam` is replaced with `this`. Later, FunctionInlineMutator can't make difference between original `this` inside *function body* and former `closureParam` reference that became `this` after replacement. So, let FunctionInlineMutator replace `this` in *function body* and then substitute closure parameters.
KT-11875 Fixed
19 lines
282 B
Kotlin
Vendored
19 lines
282 B
Kotlin
Vendored
package foo
|
|
|
|
inline fun<T> with1(value: T, p: T.() -> Unit) = value.p()
|
|
|
|
class A(val expected: String) {
|
|
val b = B()
|
|
|
|
fun foo(): A {
|
|
with1(b) {
|
|
y = expected
|
|
}
|
|
return this
|
|
}
|
|
}
|
|
class B() {
|
|
var y = ""
|
|
}
|
|
|
|
fun box() = A("OK").foo().b.y |