From c9da492d10bb05d72f807d67caeaa8fd81b88e64 Mon Sep 17 00:00:00 2001
From: "Paolo G. Giarrusso"
Date: Wed, 9 May 2018 21:00:53 +0200
Subject: [PATCH 1/2] Ensure `-YshowSuppressedErrors` also affects
`UniqueMessagePositions`
As a followup to the earlier bugfix.
---
.../src/dotty/tools/dotc/reporting/UniqueMessagePositions.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 {
From 67402fdc8e38da5e74f52809e6ad534f8d3dba60 Mon Sep 17 00:00:00 2001
From: "Paolo G. Giarrusso"
Date: Wed, 9 May 2018 20:59:46 +0200
Subject: [PATCH 2/2] Narrow position of errors due to `TypeError` to limit
hiding
---
compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)