From 6b26f3b6a187c4c8f606b8f7e4b0ae84dc9cdebe Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 5 Feb 2015 12:23:21 +1000 Subject: 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(<>)` created by the pattern matcher. This commit adds a null check. --- test/files/pos/t9135.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/files/pos/t9135.scala (limited to 'test') 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] = ??? + } -- cgit v1.2.3