[K/JS, K/Wasm, K/Native] Process anonymous initializers inside classes as a part of their primary constructors ^KT-61929 Fixed

This commit is contained in:
Artem Kobzar
2023-11-17 13:04:34 +00:00
committed by Space Team
parent 3413b07550
commit e64068cf82
21 changed files with 149 additions and 2 deletions
@@ -0,0 +1,28 @@
// KT-61929
// WITH_SDTLIB
// EXPECTED_REACHABLE_NODES: 1301
package foo
fun doSomething(lambda: () -> Unit) { lambda() }
class CompilerBug(result: String) {
var result: String = "Failed"
init {
run {
object {
init {
doSomething { completed(result) }
}
}
}
}
fun completed(value: String) {
this.result = value
}
}
fun box(): String {
return CompilerBug("OK").result
}