summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-11-03 06:29:38 -0700
committerPaul Phillips <paulp@improving.org>2012-11-03 07:01:15 -0700
commit9c09c170998f74fba03990977b285e3121db32a6 (patch)
treeee12a85233e6927e5ec3698fc83f26fb46ad43e6 /src/compiler/scala/tools/nsc/typechecker/Implicits.scala
parentd3da3ef83293c0e174e07aba643b3a1f46c110c5 (diff)
downloadscala-9c09c170998f74fba03990977b285e3121db32a6.tar.gz
scala-9c09c170998f74fba03990977b285e3121db32a6.tar.bz2
scala-9c09c170998f74fba03990977b285e3121db32a6.zip
Removing unused locals and making vars into vals.
According to "git diff" the difference from master to this commit includes: Minus: 112 vals, 135 vars Plus: 165 vals, 2 vars Assuming all the removed ones were vals, which is true from 10K feet, it suggests I removed 80 unused vals and turned 133 vars into vals. There are a few other -Xlint driven improvements bundled with this, like putting double-parentheses around Some((x, y)) so it doesn't trigger the "adapting argument list" warning.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Implicits.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 5a9a4caea1..73efceb242 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -664,10 +664,6 @@ trait Implicits {
// duplicating the code here, but this is probably a
// hotspot (and you can't just call typed, need to force
// re-typecheck)
- // TODO: the return tree is ignored. This seems to make
- // no difference, but it's bad practice regardless.
-
-
val checked = itree2 match {
case TypeApply(fun, args) => typedTypeApply(itree2, EXPRmode, fun, args)
case Apply(TypeApply(fun, args), _) => typedTypeApply(itree2, EXPRmode, fun, args) // t2421c
@@ -677,7 +673,7 @@ trait Implicits {
if (context.hasErrors)
fail("typing TypeApply reported errors for the implicit tree: " + context.errBuffer.head.errMsg)
else {
- val result = new SearchResult(itree2, subst)
+ val result = new SearchResult(checked, subst)
if (Statistics.canEnable) Statistics.incCounter(foundImplicits)
printInference("[success] found %s for pt %s".format(result, ptInstantiated))
result
@@ -1205,7 +1201,7 @@ trait Implicits {
}
)
// todo. migrate hardcoded materialization in Implicits to corresponding implicit macros
- var materializer = atPos(pos.focus)(gen.mkMethodCall(TagMaterializers(tagClass), List(tp), if (prefix != EmptyTree) List(prefix) else List()))
+ val materializer = atPos(pos.focus)(gen.mkMethodCall(TagMaterializers(tagClass), List(tp), if (prefix != EmptyTree) List(prefix) else List()))
if (settings.XlogImplicits.value) println("materializing requested %s.%s[%s] using %s".format(pre, tagClass.name, tp, materializer))
if (context.macrosEnabled) success(materializer)
// don't call `failure` here. if macros are disabled, we just fail silently