summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.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/Namers.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/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 4bebc0fddc..9f83e2a749 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1061,7 +1061,7 @@ trait Namers { self: Analyzer =>
val tparamSyms = typer.reenterTypeParams(tparams) //@M make tparams available in scope (just for this abstypedef)
val tp = typer.typedType(rhs).tpe match {
case TypeBounds(lt, rt) if (lt.isError || rt.isError) =>
- TypeBounds(NothingClass.tpe, AnyClass.tpe)
+ TypeBounds.empty
case tp @ TypeBounds(lt, rt) if (tpsym hasFlag JAVA) =>
TypeBounds(lt, objToAny(rt))
case tp =>