summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-04-30 20:01:00 +0000
committerPaul Phillips <paulp@improving.org>2011-04-30 20:01:00 +0000
commit793796eee0769926a3162d69dd23c282ca2d8ba4 (patch)
tree74158caa4474b31e69f20d976fd4966758826832 /src
parentacc5311c157358c99420ba5a8be4231ffae9fc8e (diff)
downloadscala-793796eee0769926a3162d69dd23c282ca2d8ba4.tar.gz
scala-793796eee0769926a3162d69dd23c282ca2d8ba4.tar.bz2
scala-793796eee0769926a3162d69dd23c282ca2d8ba4.zip
Don't crash the pickler with erroneous types.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
index 0940598bd2..862e37ec2b 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
@@ -56,6 +56,15 @@ abstract class Pickler extends SubComponent {
case _ =>
}
}
+ // If there are any erroneous types in the tree, then we will crash
+ // when we pickle it: so let's report an erorr instead. We know next
+ // to nothing about what happened, but our supposition is a lot better
+ // than "bad type: <error>" in terms of explanatory power.
+ for (t <- unit.body ; if t.isErroneous) {
+ unit.error(t.pos, "erroneous or inaccessible type")
+ return
+ }
+
pickle(unit.body)
}
}