aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-03 14:21:33 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-03 14:21:33 +0100
commitfd5e45bd71c972fddc0f835cdb011beb76a77770 (patch)
tree619ca441a99605f228add3667ae18d04d463d626 /src/dotty/tools/dotc/typer/Applications.scala
parent2d500b7746a38647c7a97db99207ca4972cd49eb (diff)
downloaddotty-fd5e45bd71c972fddc0f835cdb011beb76a77770.tar.gz
dotty-fd5e45bd71c972fddc0f835cdb011beb76a77770.tar.bz2
dotty-fd5e45bd71c972fddc0f835cdb011beb76a77770.zip
Making printing configurable.
Special by-topic printers that can be turned off.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 2c1384524..5c05b87a0 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -23,6 +23,7 @@ import Inferencing._
import EtaExpansion._
import collection.mutable
import reflect.ClassTag
+import config.Printers._
import language.implicitConversions
object Applications {
@@ -636,12 +637,12 @@ trait Applications extends Compatibility { self: Typer =>
unapply.tpe.widen match {
case mt: MethodType if mt.paramTypes.length == 1 && !mt.isDependent =>
val unapplyArgType = mt.paramTypes.head
- println(s"unapp arg tpe = ${unapplyArgType.show}, pt = ${pt.show}")
+ unapp.println(s"unapp arg tpe = ${unapplyArgType.show}, pt = ${pt.show}")
def wpt = widenForMatchSelector(pt)
val ownType =
if (pt <:< unapplyArgType) {
fullyDefinedType(unapplyArgType, "extractor argument", tree.pos)
- println(i"case 1 $unapplyArgType ${ctx.typerState.constraint}")
+ unapp.println(i"case 1 $unapplyArgType ${ctx.typerState.constraint}")
pt
}
else if (unapplyArgType <:< wpt) {
@@ -662,16 +663,16 @@ trait Applications extends Compatibility { self: Typer =>
if (ctx.settings.verbose.value) ctx.warning(msg, tree.pos)
}
else {
- println(s" ${unapply.symbol.owner} ${unapply.symbol.owner is Scala2x}")
+ unapp.println(s" ${unapply.symbol.owner} ${unapply.symbol.owner is Scala2x}")
ctx.error(msg, tree.pos)
}
case _ =>
}
- println(i"case 2 $unapplyArgType ${ctx.typerState.constraint}")
+ unapp.println(i"case 2 $unapplyArgType ${ctx.typerState.constraint}")
unapplyArgType
} else {
- // println("Neither sub nor super")
- // println(TypeComparer.explained(implicit ctx => unapplyArgType <:< wpt))
+ unapp.println("Neither sub nor super")
+ unapp.println(TypeComparer.explained(implicit ctx => unapplyArgType <:< wpt))
errorType(
i"Pattern type $unapplyArgType is neither a subtype nor a supertype of selector type $wpt",
tree.pos)
@@ -696,7 +697,7 @@ trait Applications extends Compatibility { self: Typer =>
}
val unapplyPatterns = (bunchedArgs, argTypes).zipped map (typed(_, _))
val result = cpy.UnApply(tree, unapply, unapplyImplicits, unapplyPatterns) withType ownType
- println(s"unapply patterns = $unapplyPatterns")
+ unapp.println(s"unapply patterns = $unapplyPatterns")
if ((ownType eq pt) || ownType.isError) result
else Typed(result, TypeTree(ownType))
case tp =>