aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-02-06 17:24:19 +0100
committerMartin Odersky <odersky@gmail.com>2013-02-06 17:24:19 +0100
commit5c773fb117b424a11d6e9e3a30033887b80557f6 (patch)
tree82e6c06302f72c23fec6aa6a3d2a6898a68e16d9 /src/dotty/tools/dotc/core/Types.scala
parentf8e3a9bf3a5f2550a20d59c8d025f2c7247ed1fd (diff)
downloaddotty-5c773fb117b424a11d6e9e3a30033887b80557f6.tar.gz
dotty-5c773fb117b424a11d6e9e3a30033887b80557f6.tar.bz2
dotty-5c773fb117b424a11d6e9e3a30033887b80557f6.zip
Some additions to symbols, in particular copiers.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 5a8d5b05d..54be24ab0 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -599,9 +599,6 @@ object Types {
private[this] var lastDenotation: Denotation = null
- private def checkPrefix(denot: Denotation) =
- denot.info.isRealTypeBounds || denot.symbol.isClass
-
/** The denotation currently denoted by this type */
def denot(implicit ctx: Context): Denotation = {
val validPeriods =
@@ -614,7 +611,9 @@ object Types {
} else {
val d = loadDenot
if (d.exists || ctx.phaseId == FirstPhaseId) {
- if (checkPrefix(d) && !prefix.isLegalPrefix)
+ val checkPrefix =
+ d.info.isRealTypeBounds || d.symbol.isClass
+ if (checkPrefix && !prefix.isLegalPrefix)
throw new MalformedType(prefix, d.symbol)
d
} else {// name has changed; try load in earlier phase and make current
@@ -659,7 +658,7 @@ object Types {
}
final class TermRefBySym(prefix: Type, val fixedSym: TermSymbol)(implicit initctx: Context)
- extends TermRef(prefix, fixedSym.name(initctx)) with HasFixedSym {
+ extends TermRef(prefix, fixedSym.name(initctx).asTermName) with HasFixedSym {
}
final class TermRefWithSignature(prefix: Type, name: TermName, override val signature: Signature) extends TermRef(prefix, name) {
@@ -669,7 +668,7 @@ object Types {
}
final class TypeRefBySym(prefix: Type, val fixedSym: TypeSymbol)(implicit initctx: Context)
- extends TypeRef(prefix, fixedSym.name(initctx)) with HasFixedSym {
+ extends TypeRef(prefix, fixedSym.name(initctx).asTypeName) with HasFixedSym {
}
final class CachedTermRef(prefix: Type, name: TermName) extends TermRef(prefix, name)