From d13fa248d5c53b165ab4f927099d0e25303ef39a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 10 Oct 2013 12:31:59 +0200 Subject: Added disambiguation for reported messages. Added method disambiguate which disambiguates any string-returning operation. Disambiguation is done by adding owners and qualifiers each symbol has a unique string representation. --- src/dotty/tools/dotc/typer/ErrorReporting.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/typer/ErrorReporting.scala') diff --git a/src/dotty/tools/dotc/typer/ErrorReporting.scala b/src/dotty/tools/dotc/typer/ErrorReporting.scala index 314ef9899..16f994e90 100644 --- a/src/dotty/tools/dotc/typer/ErrorReporting.scala +++ b/src/dotty/tools/dotc/typer/ErrorReporting.scala @@ -9,6 +9,7 @@ import Types._, Inferencing._, Contexts._, Decorators._, Denotations._, Symbols. import Applications._, Implicits._ import util.Positions._ import printing.Showable +import printing.Disambiguation.disambiguated import reporting.Reporter.SuppressedMessage object ErrorReporting { @@ -67,7 +68,7 @@ object ErrorReporting { errorTree(tree, typeMismatchStr(tree.tpe, pt) + implicitFailure.postscript) } - def typeMismatchStr(found: Type, expected: Type) = { + def typeMismatchStr(found: Type, expected: Type) = disambiguated { implicit ctx => val (typerStateStr, explanationStr) = if (ctx.settings.explaintypes.value) { val nestedCtx = ctx.fresh.withTypeComparerFn(new ExplainingTypeComparer(_)) -- cgit v1.2.3