aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/ast/tpd.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-02 13:47:45 +1100
committerMartin Odersky <odersky@gmail.com>2017-02-02 13:49:54 +1100
commit4585dcbaeb75df072f1a50ea6b7a9cb3fcfad4ee (patch)
treeaac7bc4e5fe6fc239a5e1fd6b239751eae126281 /compiler/src/dotty/tools/dotc/ast/tpd.scala
parent64332a794c05cbf21491eaf0bfdf4482a80b1b10 (diff)
downloaddotty-4585dcbaeb75df072f1a50ea6b7a9cb3fcfad4ee.tar.gz
dotty-4585dcbaeb75df072f1a50ea6b7a9cb3fcfad4ee.tar.bz2
dotty-4585dcbaeb75df072f1a50ea6b7a9cb3fcfad4ee.zip
Fix #1568 - avoid transforming error trees
If a tree has type error, subtrees may not have an assigned type. Therefore we should avoid transforming such trees.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/ast/tpd.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/ast/tpd.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala
index 433808e8e..565ec5ce2 100644
--- a/compiler/src/dotty/tools/dotc/ast/tpd.scala
+++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala
@@ -573,6 +573,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
Try(tree: Tree)(expr, cases, finalizer)
}
+ override def skipTransform(tree: Tree)(implicit ctx: Context) = tree.tpe.isError
+
implicit class TreeOps[ThisTree <: tpd.Tree](val tree: ThisTree) extends AnyVal {
def isValue(implicit ctx: Context): Boolean =