aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ErrorReporting.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-10 18:38:41 +0200
committerMartin Odersky <odersky@gmail.com>2013-10-10 18:38:41 +0200
commitb4c0e4af5ef03384f24e370059724be7c1ca6fb3 (patch)
tree8079557288014aa1e5c9815e83189491dc9415e8 /src/dotty/tools/dotc/typer/ErrorReporting.scala
parent7ebb48127be6c02578596d0b9e627af250d11863 (diff)
downloaddotty-b4c0e4af5ef03384f24e370059724be7c1ca6fb3.tar.gz
dotty-b4c0e4af5ef03384f24e370059724be7c1ca6fb3.tar.bz2
dotty-b4c0e4af5ef03384f24e370059724be7c1ca6fb3.zip
Fixed missing type comparisons for bound types.
Also, new method "explained" in TypeComparers.
Diffstat (limited to 'src/dotty/tools/dotc/typer/ErrorReporting.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ErrorReporting.scala10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/ErrorReporting.scala b/src/dotty/tools/dotc/typer/ErrorReporting.scala
index 16f994e90..9b6188fe6 100644
--- a/src/dotty/tools/dotc/typer/ErrorReporting.scala
+++ b/src/dotty/tools/dotc/typer/ErrorReporting.scala
@@ -70,12 +70,10 @@ object ErrorReporting {
def typeMismatchStr(found: Type, expected: Type) = disambiguated { implicit ctx =>
val (typerStateStr, explanationStr) =
- if (ctx.settings.explaintypes.value) {
- val nestedCtx = ctx.fresh.withTypeComparerFn(new ExplainingTypeComparer(_))
- (found <:< expected)(nestedCtx)
- ("\n" + ctx.typerState.show, "\n" + nestedCtx.typeComparer.toString)
- }
- else ("", "")
+ if (ctx.settings.explaintypes.value)
+ ("\n" + ctx.typerState.show, "\n" + TypeComparer.explained((found <:< expected)(_)))
+ else
+ ("", "")
i"""type mismatch:
| found : $found
| required: $expected""".stripMargin + typerStateStr + explanationStr