blob: a6962847cb833ae421b4cef9e87305b329c80b02 (
plain) (
tree)
|
|
object Test {
def monitor(x: AnyRef): Unit = {x.synchronized(()); ()}
def check(x: => Any) = try { x; sys.error("failed to throw NPE") } catch { case _: NullPointerException => }
def main(args: Array[String]): Unit = {
check(monitor(null))
}
}
|