Use 'run' function instead of 'synchronized' in KT-51036 test

It should be enough to reproduce the issue and makes the test runnable on all backends
This commit is contained in:
Ilya Gorbunov
2023-04-26 14:20:18 +02:00
committed by Space Team
parent 92a7a74382
commit 568d4b11af
4 changed files with 5 additions and 74 deletions
+1 -6
View File
@@ -1,8 +1,4 @@
// WITH_STDLIB
// IGNORE_BACKEND: WASM
// ^ Unresolved reference: synchronized
// IGNORE_BACKEND: NATIVE
// ^ Unresolved reference: synchronized
fun box(): String {
A().close()
@@ -12,6 +8,5 @@ fun box(): String {
class A {
companion object;
operator fun String.invoke() = Unit
@Suppress("DEPRECATION_ERROR")
fun close() = synchronized(this) { "abc" }()
fun close() = kotlin.run { "abc" }()
}