summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-31 12:52:54 -0700
committerPaul Phillips <paulp@improving.org>2012-04-01 08:27:09 -0700
commitf7535f72903f083b2444fb1d0b73363efa5482e9 (patch)
tree8f8872c0d1f4f9810530baf574b9d1aa8e049033 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent17356bf8a3eddb5b6652884ee5b96970d3ddb6cf (diff)
downloadscala-f7535f72903f083b2444fb1d0b73363efa5482e9.tar.gz
scala-f7535f72903f083b2444fb1d0b73363efa5482e9.tar.bz2
scala-f7535f72903f083b2444fb1d0b73363efa5482e9.zip
Pushed Symbol/Type creation partitioning further.
Yet more funnelling of immutable creation-time known information into the identities of symbols and types.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index ae184d2677..2aff00f6a5 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -253,22 +253,23 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
/** Check that `tpt` refers to a class type with a stable prefix. */
def checkStablePrefixClassType(tpt: Tree): Boolean = {
val tpe = unwrapToStableClass(tpt.tpe)
-
def prefixIsStable = {
def checkPre = tpe match {
case TypeRef(pre, _, _) => pre.isStable || errorNotStable(tpt, pre)
- case _ => true
+ case _ => false
}
// A type projection like X#Y can get by the stable check if the
// prefix is singleton-bounded, so peek at the tree too.
def checkTree = tpt match {
- case SelectFromTypeTree(qual, _) => isSingleType(qual.tpe) || errorNotStable(tpt, qual.tpe)
+ case SelectFromTypeTree(qual, _) => isSingleType(qual.tpe) || errorNotClass(tpt, tpe)
case _ => true
}
checkPre && checkTree
}
- isNonRefinementClassType(tpe) && (isPastTyper || prefixIsStable)
+ ( (isNonRefinementClassType(tpe) || errorNotClass(tpt, tpe))
+ && (isPastTyper || prefixIsStable)
+ )
}
/** Check that type <code>tp</code> is not a subtype of itself.