Files
kotlin/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/wait.kt
2014-07-02 22:05:45 +04:00

16 lines
286 B
Kotlin

fun box(): String {
val obj = "" as java.lang.Object
try {
obj.wait(1)
return "Fail: exception should have been thrown"
}
catch (e: IllegalMonitorStateException) {
// OK
}
synchronized (obj) {
obj.wait(1)
}
return "OK"
}