From 0625f0cbc2e0a213df39d6b261afab49d5d23f53 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 6 Nov 2012 12:01:52 +0100 Subject: comment / question in typers --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compiler') 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), -- cgit v1.2.3