diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-02-05 12:23:21 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-02-05 12:23:21 +1000 |
commit | 6b26f3b6a187c4c8f606b8f7e4b0ae84dc9cdebe (patch) | |
tree | 14f9bcade08538331530bbd66d1ca76df9d2e84f /src | |
parent | 67fd6557af837b19ff68f9292790bd293ce8009b (diff) | |
download | scala-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 'src')
-rw-r--r-- | src/reflect/scala/reflect/internal/Trees.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Trees.scala b/src/reflect/scala/reflect/internal/Trees.scala index ccf907e05d..fd918b8595 100644 --- a/src/reflect/scala/reflect/internal/Trees.scala +++ b/src/reflect/scala/reflect/internal/Trees.scala @@ -1622,7 +1622,7 @@ trait Trees extends api.Trees { } private def invalidateSingleTypeCaches(tree: Tree): Unit = { if (mutatedSymbols.nonEmpty) - for (t <- tree) + for (t <- tree if t.tpe != null) for (tp <- t.tpe) { tp match { case s: SingleType if mutatedSymbols contains s.sym => |