JVM_IR: generate "safe" names for functions in init blocks

This commit is contained in:
Dmitry Petrov
2020-07-22 11:53:05 +03:00
parent bb8f857809
commit 1272162a7f
14 changed files with 209 additions and 6 deletions
@@ -0,0 +1,28 @@
// IGNORE_BACKEND_FIR: JVM_IR
lateinit var result1: String
lateinit var result2: String
class Test(val x: String) {
fun test(a: String) {
if (result1 != a) throw AssertionError("result1: $result1")
result2 = a
}
init {
fun test() {
fun test1() {
result1 = x
}
test1()
}
test()
}
}
fun box(): String {
val t = Test("OK")
t.test("OK")
return result2
}