26c1098a4f
* Fix objects in inline functions and lambdas: * Add common lowerings used in K/JS and K/Native * Fix inline lambda call detection logic in presence of additional casts Merge-request: KT-MR-8791 Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
26 lines
473 B
Kotlin
Vendored
26 lines
473 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM
|
|
// 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"
|
|
}
|