Generate unique parameter names in LocalDeclarationsLowering

This commit is contained in:
pyos
2019-10-04 14:41:28 +02:00
committed by max-kammerer
parent 3b2843fe7a
commit cd47c11efd
14 changed files with 87 additions and 10 deletions
@@ -0,0 +1,6 @@
fun String.f(x: String): String {
fun String.g() = { this@f + this@g }()
return x.g()
}
fun box() = "O".f("K")
@@ -1,5 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
// FILE: 1.kt
// SKIP_INLINE_CHECK_IN: inlineFun$default
package test
@@ -0,0 +1,11 @@
// FILE: 1.kt
inline fun f(g: () -> String) = g()
// FILE: 2.kt
class A(val x: String) {
inner class B(val y: String) {
fun h() = f { x + y }
}
}
fun box() = A("O").B("K").h()
@@ -19,4 +19,10 @@ fun box(): String {
// One instance of each is in kotlin.Metadata.d2
// 1 \(X\)
// JVM_TEMPLATES
// 1 \(Y\)
// JVM_IR_TEMPLATES
// 5 \(Y\)
// 4 \$this\$\(Y\)