aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t8601d.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/t8601d.scala')
-rw-r--r--tests/run/t8601d.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/run/t8601d.scala b/tests/run/t8601d.scala
new file mode 100644
index 000000000..a6962847c
--- /dev/null
+++ b/tests/run/t8601d.scala
@@ -0,0 +1,8 @@
+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))
+ }
+}