diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-11-06 12:01:52 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-11-06 21:09:21 +0100 |
commit | 0625f0cbc2e0a213df39d6b261afab49d5d23f53 (patch) | |
tree | d016bda8c579523df8f486764fbef64ec98c9c7b /src | |
parent | 9d265965294e65c8f20a027254042c9468af83d9 (diff) | |
download | scala-0625f0cbc2e0a213df39d6b261afab49d5d23f53.tar.gz scala-0625f0cbc2e0a213df39d6b261afab49d5d23f53.tar.bz2 scala-0625f0cbc2e0a213df39d6b261afab49d5d23f53.zip |
comment / question in typers
Diffstat (limited to 'src')
-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 3d80df405d..61baa978ba 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) } @@ -5212,7 +5214,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 { @@ -5222,7 +5223,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), |