diff --git a/compiler/src/dotty/tools/dotc/reporting/UniqueMessagePositions.scala b/compiler/src/dotty/tools/dotc/reporting/UniqueMessagePositions.scala index 6fd971c2a4c0..b7049f8038b6 100644 --- a/compiler/src/dotty/tools/dotc/reporting/UniqueMessagePositions.scala +++ b/compiler/src/dotty/tools/dotc/reporting/UniqueMessagePositions.scala @@ -18,7 +18,7 @@ trait UniqueMessagePositions extends Reporter { */ override def isHidden(m: MessageContainer)(implicit ctx: Context): Boolean = super.isHidden(m) || { - m.pos.exists && { + m.pos.exists && !ctx.settings.YshowSuppressedErrors.value && { var shouldHide = false for (pos <- m.pos.start to m.pos.end) { positions get (ctx.source, pos) match { diff --git a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala index 6e03384e31e1..bb71813b60fc 100644 --- a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala +++ b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala @@ -16,7 +16,7 @@ object ErrorReporting { import tpd._ def errorTree(tree: untpd.Tree, msg: => Message)(implicit ctx: Context): tpd.Tree = - tree withType errorType(msg, tree.pos) + tree withType errorType(msg, tree.pos.focus) def errorType(msg: => Message, pos: Position)(implicit ctx: Context): ErrorType = { ctx.error(msg, pos)