c7435ba760
We are going to deprecate `WITH_RUNTIME` directive. The main reason behind this change is that `WITH_STDLIB` directive better describes its meaning, specifically it will add kotlin stdlib to test's classpath.
28 lines
526 B
Kotlin
Vendored
28 lines
526 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM
|
|
// IGNORE_BACKEND: WASM
|
|
// WASM_MUTE_REASON: UNKNOWN
|
|
// WITH_STDLIB
|
|
|
|
interface Runnable {
|
|
fun run()
|
|
}
|
|
|
|
class AnonymousClassInLambda {
|
|
fun run(): Int {
|
|
var x = 0
|
|
val threads = (1..10).map {
|
|
object : Runnable {
|
|
override fun run() {
|
|
x++
|
|
}
|
|
}
|
|
}
|
|
threads.forEach { it.run() }
|
|
return x
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return if (AnonymousClassInLambda().run() == 10) "OK" else "Fail"
|
|
}
|