diff options
author | Martin Odersky <odersky@gmail.com> | 2016-12-17 15:09:27 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-12-17 15:09:52 +0100 |
commit | b63480a59bbdd284a5e32281fbb0037e509f4b1e (patch) | |
tree | 825824024ad6768646c3dbf630a2db9283eedcd4 /compiler/src/dotty/tools/backend/jvm | |
parent | 653698ef67a5cf8f5e0fd0fcdcd1f631f1dc96e2 (diff) | |
download | dotty-b63480a59bbdd284a5e32281fbb0037e509f4b1e.tar.gz dotty-b63480a59bbdd284a5e32281fbb0037e509f4b1e.tar.bz2 dotty-b63480a59bbdd284a5e32281fbb0037e509f4b1e.zip |
Make errors are not swept under the carpet
Typer#ensureReported's comment outlines an example where errors
could go unreported, resulting in error trees after typer without
any reported error messages. This commit makes sure that at least
one error is reported if a tree node has an error type.
Fixes #1802.
Diffstat (limited to 'compiler/src/dotty/tools/backend/jvm')
-rw-r--r-- | compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala | 2 | ||||
-rw-r--r-- | compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index ed32d2df9..123dc3450 100644 --- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -1024,7 +1024,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma case JavaArrayType(elem) => elem case _ => ctx.error(s"JavaSeqArray with type ${field.tpe} reached backend: $field", field.pos) - ErrorType + UnspecifiedErrorType } def _2: List[Tree] = field.elems } diff --git a/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala b/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala index eb4da5400..89831e56b 100644 --- a/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala +++ b/compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala @@ -12,7 +12,7 @@ import dotty.tools.dotc.ast.tpd._ import dotty.tools.dotc.core.Names.TermName import dotty.tools.dotc.core.StdNames import dotty.tools.dotc.core.StdNames._ -import dotty.tools.dotc.core.Types.{JavaArrayType, ErrorType, Type} +import dotty.tools.dotc.core.Types.{JavaArrayType, UnspecifiedErrorType, Type} import scala.collection.{ mutable, immutable } @@ -73,7 +73,7 @@ class DottyPrimitives(ctx: Context) { case JavaArrayType(el) => el case _ => ctx.error(s"expected Array $tpe") - ErrorType + UnspecifiedErrorType } code match { |