summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-03-11 22:11:20 -0700
committerPaul Phillips <paulp@improving.org>2013-03-12 07:35:49 -0700
commitfc5e5581ec2eb91d22cbc8a2f19729c7c9a87254 (patch)
treea3d9b6faf5b007ff4a8e17f6ac066e1c8959c6e3 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parent9fed30cb9c6d86ca07286febeb44bf635cb23650 (diff)
downloadscala-fc5e5581ec2eb91d22cbc8a2f19729c7c9a87254.tar.gz
scala-fc5e5581ec2eb91d22cbc8a2f19729c7c9a87254.tar.bz2
scala-fc5e5581ec2eb91d22cbc8a2f19729c7c9a87254.zip
Eliminate a bunch of -Xlint warnings.
Mostly unused private code, unused imports, and points where an extra pair of parentheses is necessary for scalac to have confidence in our intentions.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 429bd7d682..836e0c3a38 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -594,11 +594,11 @@ trait Contexts { self: Analyzer =>
def restore(): Type = savedTypeBounds.foldLeft(tp) { case (current, (sym, savedInfo)) =>
def bounds_s(tb: TypeBounds) = if (tb.isEmptyBounds) "<empty bounds>" else s"TypeBounds(lo=${tb.lo}, hi=${tb.hi})"
//@M TODO: when higher-kinded types are inferred, probably need a case PolyType(_, TypeBounds(...)) if ... =>
- val tb @ TypeBounds(lo, hi) = sym.info.bounds
- val isUnique = lo <:< hi && hi <:< lo
- val isPresent = current contains sym
- def saved_s = bounds_s(savedInfo.bounds)
- def current_s = bounds_s(sym.info.bounds)
+ val TypeBounds(lo, hi) = sym.info.bounds
+ val isUnique = lo <:< hi && hi <:< lo
+ val isPresent = current contains sym
+ def saved_s = bounds_s(savedInfo.bounds)
+ def current_s = bounds_s(sym.info.bounds)
if (isUnique && isPresent)
devWarningResult(s"Preserving inference: ${sym.nameString}=$hi in $current (based on $current_s) before restoring $sym to saved $saved_s")(
@@ -962,15 +962,15 @@ trait Contexts { self: Analyzer =>
// import check from being misled by symbol lookups which are not
// actually used.
val other = lookupImport(imp2, requireExplicit = !sameDepth)
- def imp1wins = { imports = imp1 :: imports.tail.tail }
- def imp2wins = { impSym = other ; imports = imports.tail }
+ def imp1wins() = { imports = imp1 :: imports.tail.tail }
+ def imp2wins() = { impSym = other ; imports = imports.tail }
if (!other.exists) // imp1 wins; drop imp2 and continue.
- imp1wins
+ imp1wins()
else if (sameDepth && !imp1Explicit && imp2Explicit) // imp2 wins; drop imp1 and continue.
- imp2wins
+ imp2wins()
else resolveAmbiguousImport(name, imp1, imp2) match {
- case Some(imp) => if (imp eq imp1) imp1wins else imp2wins
+ case Some(imp) => if (imp eq imp1) imp1wins() else imp2wins()
case _ => lookupError = ambiguousImports(imp1, imp2)
}
}