diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-21 21:03:11 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-26 22:54:18 -0700 |
commit | b0b0abab89f0c40ba3c45b4a1f7bada31040d55a (patch) | |
tree | c98ae4100c042010e5178ec4d1ec15abf5a73b41 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 49d946d9039a6240765abd26375883875e5ff7e8 (diff) | |
download | scala-b0b0abab89f0c40ba3c45b4a1f7bada31040d55a.tar.gz scala-b0b0abab89f0c40ba3c45b4a1f7bada31040d55a.tar.bz2 scala-b0b0abab89f0c40ba3c45b4a1f7bada31040d55a.zip |
Jason's review feedback (ThisReferringMethodTraverser)
- Re-simplify logging;
- Remove unused method valueTypeToObject;
- Limit ThisReferringMethodTraverser to material parts
of the AST
Limit ThisReferringMethodTraverser's analysis to only look at
template-owned anonfun method bodies, to make sure it's fairly
low overhead.
AFAICT, part of the complexity of this analysis stems from the
desire to make all the lambda impl methods static in
`() => () => 42`: https://gist.github.com/062181846c13e65490cc.
It would possible to accumulate the knowledge we need during the
main transform, rather than in an additional pass. We'd need to
transform template bodies in such a way that we we process
definitions of anonfun methods before usages, which would
currently amount to transforming the stats in reverse.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 4f006fe9a9..3b826ae2e5 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1058,11 +1058,9 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper inferView(tree, tree.tpe, pt) match { case EmptyTree => // didn't find a view -- fall through case coercion => - if (settings.debug || settings.logImplicitConv) { - val msg = s"inferred view from ${tree.tpe} to $pt via $coercion: ${coercion.tpe}" - debuglog(msg) - if (settings.logImplicitConv) context.echo(tree.pos, msg) - } + def msg = s"inferred view from ${tree.tpe} to $pt via $coercion: ${coercion.tpe}" + if (settings.logImplicitConv) context.echo(tree.pos, msg) + else debuglog(msg) val silentContext = context.makeImplicit(context.ambiguousErrors) val res = newTyper(silentContext).typed( |