aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeComparer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-04-27 10:33:00 +0200
committerMartin Odersky <odersky@gmail.com>2016-04-27 14:01:41 +0200
commit5e599cc14ac0dfe9f7b7605e537808c927e7a6a3 (patch)
tree76c27f128a5aed82d52dda4ca1c5d79f6aff9a19 /src/dotty/tools/dotc/core/TypeComparer.scala
parent4d7aaf637edafa1305602fc9f63b4c2ed4288ad5 (diff)
downloaddotty-5e599cc14ac0dfe9f7b7605e537808c927e7a6a3.tar.gz
dotty-5e599cc14ac0dfe9f7b7605e537808c927e7a6a3.tar.bz2
dotty-5e599cc14ac0dfe9f7b7605e537808c927e7a6a3.zip
Rename Reporting#println -> Reporting#echo
There's a trap otherwise that, when in a class inheriting from Context (and with it Reporting) a call to println will go to this.println and therefore might not print at all, if the current context buffers messages. I lost a lot of time on this on several occasions when I scratched my head why a simple debug println would not show. Better avoid this in the future for myself and others.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeComparer.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index dbee86549..a10b1fd0e 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -1295,10 +1295,10 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
def showGoal(tp1: Type, tp2: Type)(implicit ctx: Context) = {
println(disambiguated(implicit ctx => s"assertion failure for ${tp1.show} <:< ${tp2.show}, frozen = $frozenConstraint"))
def explainPoly(tp: Type) = tp match {
- case tp: PolyParam => ctx.println(s"polyparam ${tp.show} found in ${tp.binder.show}")
- case tp: TypeRef if tp.symbol.exists => ctx.println(s"typeref ${tp.show} found in ${tp.symbol.owner.show}")
- case tp: TypeVar => ctx.println(s"typevar ${tp.show}, origin = ${tp.origin}")
- case _ => ctx.println(s"${tp.show} is a ${tp.getClass}")
+ case tp: PolyParam => ctx.echo(s"polyparam ${tp.show} found in ${tp.binder.show}")
+ case tp: TypeRef if tp.symbol.exists => ctx.echo(s"typeref ${tp.show} found in ${tp.symbol.owner.show}")
+ case tp: TypeVar => ctx.echo(s"typevar ${tp.show}, origin = ${tp.origin}")
+ case _ => ctx.echo(s"${tp.show} is a ${tp.getClass}")
}
explainPoly(tp1)
explainPoly(tp2)