summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-07 19:07:01 +0000
committerPaul Phillips <paulp@improving.org>2011-01-07 19:07:01 +0000
commit32e7c243272d7aaae6c662aa3e1716dae61e1117 (patch)
treeec61af7fab062994641da341d5aea4c8aaf67fa3 /src/compiler/scala/tools/nsc/typechecker/Implicits.scala
parent148736c3df1fa6463b4b2658c01bcf452a52c224 (diff)
downloadscala-32e7c243272d7aaae6c662aa3e1716dae61e1117.tar.gz
scala-32e7c243272d7aaae6c662aa3e1716dae61e1117.tar.bz2
scala-32e7c243272d7aaae6c662aa3e1716dae61e1117.zip
Great moments in code reuse:
def isRootOrEmptyPackageClass(s: Symbol) = s.isRoot || s.isEmptyPackageClass def isRootOrEmpty = (this == EmptyPackageClass) || (this == RootClass) def isEffectiveRoot = isRoot || isEmptyPackageClass // last one actually not quite identical def isUnqualified(n: Name) = n match { case nme.ROOT | nme.EMPTY_PACKAGE_NAME => true ; case _ => false } I was responsible for at least half of these. Now it's only isEffectiveRoot. Also, I have always found it warty that we have to specify Nothing and Any as upper bounds. I gave the TypeBounds companion object a few obvious methods: def empty: TypeBounds = apply(NothingClass.tpe, AnyClass.tpe) def upper(hi: Type): TypeBounds = apply(NothingClass.tpe, hi) def lower(lo: Type): TypeBounds = apply(lo, AnyClass.tpe) It's a lovable patch. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Implicits.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 3a84bdc9e4..6a708a873c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -698,7 +698,7 @@ trait Implicits {
*/
def applicableInfos(iss: Infoss, isLocal: Boolean): Map[ImplicitInfo, SearchResult] = {
val start = startCounter(subtypeAppInfos)
- val computation = new ImplicitComputation(iss, if (isLocal) new util.HashSet[Name](512) else null) { }
+ val computation = new ImplicitComputation(iss, if (isLocal) util.HashSet[Name](512) else null) { }
val applicable = computation.findAll()
stopCounter(subtypeAppInfos, start)
@@ -716,7 +716,7 @@ trait Implicits {
*/
def searchImplicit(implicitInfoss: Infoss, isLocal: Boolean): SearchResult =
if (implicitInfoss.forall(_.isEmpty)) SearchFailure
- else new ImplicitComputation(implicitInfoss, if (isLocal) new util.HashSet[Name](512) else null) findBest()
+ else new ImplicitComputation(implicitInfoss, if (isLocal) util.HashSet[Name](128) else null) findBest()
/** The parts of a type is the smallest set of types that contains
* - the type itself