Restore accidentally removed parameter index passing to call generator

Parameter index was removed in
 7690a8bc3e commit:
 "Get rid of redundant 'afterParameterPut' method from call generators"

  #KT-17653 Fixed
This commit is contained in:
Mikhael Bogdanov
2017-05-02 14:43:55 +02:00
parent 962bce19a2
commit 84eeed51b1
11 changed files with 251 additions and 13 deletions
+18
View File
@@ -0,0 +1,18 @@
// FILE: 1.kt
package test
inline fun inlineFun(vararg constraints: String, init: String.() -> String): String {
return "O".init()
}
// FILE: 2.kt
import test.*
fun box(): String {
return inlineFun {
this + "K"
}
}
@@ -0,0 +1,18 @@
// FILE: 1.kt
package test
inline fun inlineFun(vararg constraints: String, receiver: String = "O", init: String.() -> String): String {
return receiver.init()
}
// FILE: 2.kt
import test.*
fun box(): String {
return inlineFun {
this + "K"
}
}
@@ -0,0 +1,18 @@
// FILE: 1.kt
// WITH_RUNTIME
package test
inline fun inlineFun(vararg constraints: String, receiver: String = "K", init: String.() -> String): String {
return (constraints.joinToString() + receiver).init()
}
// FILE: 2.kt
import test.*
fun box(): String {
return inlineFun("O") {
this
}
}