diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-16 17:11:52 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-16 17:11:52 -0800 |
commit | 1beb44886c1f355e16f6024cfb66c54843530e2e (patch) | |
tree | 432c4c5b029103232c83b0750319f86abccbb5e1 | |
parent | 3acd3eb3ed957727757c9171b39f9f5bcdf34917 (diff) | |
parent | 0625f0cbc2e0a213df39d6b261afab49d5d23f53 (diff) | |
download | scala-1beb44886c1f355e16f6024cfb66c54843530e2e.tar.gz scala-1beb44886c1f355e16f6024cfb66c54843530e2e.tar.bz2 scala-1beb44886c1f355e16f6024cfb66c54843530e2e.zip |
Merge pull request #1581 from lrytz/typerComment
comment / question in typers
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index d9084af7bc..0a0ab53852 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -853,6 +853,8 @@ trait Typers extends Modes with Adaptations with Tags { orElse { _ => debuglog("fallback on implicits: " + tree + "/" + resetAllAttrs(original)) val tree1 = typed(resetAllAttrs(original), mode, WildcardType) + // Q: `typed` already calls `addAnnotations` and `adapt`. the only difference here is that + // we pass `EmptyTree` as the `original`. intended? added in 2009 (53d98e7d42) by martin. tree1.tpe = addAnnotations(tree1, tree1.tpe) if (tree1.isEmpty) tree1 else adapt(tree1, mode, pt, EmptyTree) } @@ -5194,7 +5196,6 @@ trait Typers extends Modes with Adaptations with Tags { lastTreeToTyper = tree indentTyping() - var alreadyTyped = false val startByType = if (Statistics.canEnable) Statistics.pushTimer(byTypeStack, byTypeNanos(tree.getClass)) else null if (Statistics.canEnable) Statistics.incCounter(visitsByType, tree.getClass) try { @@ -5204,7 +5205,7 @@ trait Typers extends Modes with Adaptations with Tags { if (tree.hasSymbolField) tree.symbol = NoSymbol } - alreadyTyped = tree.tpe ne null + val alreadyTyped = tree.tpe ne null val tree1: Tree = if (alreadyTyped) tree else { printTyping( ptLine("typing %s: pt = %s".format(ptTree(tree), pt), |