[K/Wasm] Fix object optimization false trigger on non-pure objects ^KT-66471 Fixed

This commit is contained in:
Artem Kobzar
2024-03-14 17:12:45 +00:00
committed by Space Team
parent a2a0e8cb38
commit eb8054ac1e
23 changed files with 147 additions and 1 deletions
@@ -0,0 +1,21 @@
// KT-66471
interface TestInterface {
fun foo()
}
var result: Any? = "Fail: not initialized"
object TestObject {
private val test = run {
result = TestInterface::foo
"OK"
}
fun bar() {}
}
fun box(): String {
TestObject.bar()
return if (result is Function<*>) "OK" else result.toString()
}