summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-02-05 12:23:21 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-02-05 12:23:21 +1000
commit6b26f3b6a187c4c8f606b8f7e4b0ae84dc9cdebe (patch)
tree14f9bcade08538331530bbd66d1ca76df9d2e84f /test
parent67fd6557af837b19ff68f9292790bd293ce8009b (diff)
downloadscala-6b26f3b6a187c4c8f606b8f7e4b0ae84dc9cdebe.tar.gz
scala-6b26f3b6a187c4c8f606b8f7e4b0ae84dc9cdebe.tar.bz2
scala-6b26f3b6a187c4c8f606b8f7e4b0ae84dc9cdebe.zip
SI-9135 Fix NPE, a regression in the pattern matcher
The community build discovered that #4252 introduced the possibility for a NullPointerException. The tree with a null type was a synthetic `Apply(<<matchEnd>>)` created by the pattern matcher. This commit adds a null check.
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t9135.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t9135.scala b/test/files/pos/t9135.scala
new file mode 100644
index 0000000000..1e2c97baf9
--- /dev/null
+++ b/test/files/pos/t9135.scala
@@ -0,0 +1,16 @@
+
+class Free[A] {
+
+
+ this match {
+ case a @ Gosub() => gosub(a.a)(x => gosub(???)(???))
+ }
+ def gosub[A, B](a0: Free[A])(f0: A => Any): Free[B] = ???
+}
+
+
+
+ case class Gosub[B]() extends Free[B] {
+ type C
+ def a: Free[C] = ???
+ }