aboutsummaryrefslogtreecommitdiff
path: root/tests/run/virtpatmat_npe.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/virtpatmat_npe.scala')
-rw-r--r--tests/run/virtpatmat_npe.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run/virtpatmat_npe.scala b/tests/run/virtpatmat_npe.scala
new file mode 100644
index 000000000..efa66f328
--- /dev/null
+++ b/tests/run/virtpatmat_npe.scala
@@ -0,0 +1,10 @@
+class C {
+ class D
+ val values = new Array[AnyRef](10)
+ values(0) match {
+ case name: D => println("NOK: "+ name) // the outer check on D's outer should not cause a NPE
+ case null => println("OK")
+ }
+}
+
+object Test extends C with App