diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-16 22:00:16 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-16 22:00:40 +0100 |
commit | bf59937182b66d12d01c11ff5dd27346ee4a9db4 (patch) | |
tree | da1aa5ce95b86aa9b17cd3911ef97698c5fa5f40 /src/dotty/tools/dotc/typer/Implicits.scala | |
parent | d00c3f5e7925cd246fb10916f6a2d26111ac2689 (diff) | |
download | dotty-bf59937182b66d12d01c11ff5dd27346ee4a9db4.tar.gz dotty-bf59937182b66d12d01c11ff5dd27346ee4a9db4.tar.bz2 dotty-bf59937182b66d12d01c11ff5dd27346ee4a9db4.zip |
Refactoring to avoid multiple overloaded traceIndent methods.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Implicits.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index 5ab40d529..b5f7f0366 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -62,7 +62,7 @@ object Implicits { } /** The implicit references that are eligible for expected type `tp` */ - lazy val eligible: List[TermRef] = ctx.traceIndented(implicits, i"eligible($tp), companions = ${companionRefs.toList}%, %", show = true)(filterMatching(tp)) + lazy val eligible: List[TermRef] = ctx.traceIndented(i"eligible($tp), companions = ${companionRefs.toList}%, %", implicits, show = true)(filterMatching(tp)) override def toString = i"OfTypeImplicits($tp), companions = ${companionRefs.toList}%, %; refs = $refs%, %." @@ -215,7 +215,7 @@ trait ImplicitRunInfo { self: RunInfo => // todo: compute implicits directly, without going via companionRefs? def collectCompanions(tp: Type): TermRefSet = track("computeImplicicScope") { - ctx.traceIndented(implicits, i"collectCompanions($tp)") { + ctx.traceIndented(i"collectCompanions($tp)", implicits) { val comps = new TermRefSet tp match { case tp: NamedType => @@ -295,7 +295,7 @@ trait Implicits { self: Typer => * !!! todo: catch potential cycles */ def inferImplicit(pt: Type, argument: Tree, pos: Position)(implicit ctx: Context): SearchResult = track("inferImplicit") { - ctx.traceIndented(implicits, s"search implicit ${pt.show}, arg = ${argument.show}: ${argument.tpe.show}, constraint = ${ctx.typerState.constraint.show}", show = true) { + ctx.traceIndented(s"search implicit ${pt.show}, arg = ${argument.show}: ${argument.tpe.show}, constraint = ${ctx.typerState.constraint.show}", implicits, show = true) { assert(!pt.isInstanceOf[ExprType]) val isearch = if (ctx.settings.explaintypes.value) new ExplainedImplicitSearch(pt, argument, pos) @@ -349,7 +349,7 @@ trait Implicits { self: Typer => def searchImplicits(eligible: List[TermRef], contextual: Boolean): SearchResult = { /** Try to typecheck an implicit reference */ - def typedImplicit(ref: TermRef)(implicit ctx: Context): SearchResult = track("typedImplicit") { ctx.traceIndented(implicits, i"typed implicit $ref, pt = $pt, implicitsEnabled == ${ctx.mode is ImplicitsEnabled}", show = true) { + def typedImplicit(ref: TermRef)(implicit ctx: Context): SearchResult = track("typedImplicit") { ctx.traceIndented(i"typed implicit $ref, pt = $pt, implicitsEnabled == ${ctx.mode is ImplicitsEnabled}", implicits, show = true) { var generated: Tree = Ident(ref).withPos(pos) if (!argument.isEmpty) generated = typedUnadapted( @@ -544,4 +544,6 @@ class TermRefSet(implicit ctx: Context) extends mutable.Traversable[TermRef] { for (sym <- elems.keysIterator) for (pre <- elems(sym)) f(TermRef(pre, sym)) -}
\ No newline at end of file +} + +object EmptyTermRefSet extends TermRefSet()(NoContext) |