diff options
author | Martin Odersky <odersky@gmail.com> | 2012-12-14 12:21:55 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-12-14 12:22:06 +0100 |
commit | 30cafea909e3986f7cd12264a28c0d57d7741a2a (patch) | |
tree | ddfd0de6f824500aba531e81bf426020b62d2044 /src/dotty/tools/dotc/core/Symbols.scala | |
parent | fa113713637771e91ac9f02621bbe1d25d508821 (diff) | |
download | dotty-30cafea909e3986f7cd12264a28c0d57d7741a2a.tar.gz dotty-30cafea909e3986f7cd12264a28c0d57d7741a2a.tar.bz2 dotty-30cafea909e3986f7cd12264a28c0d57d7741a2a.zip |
Re-introducing Rereferences as an intermediate structure, separate from types.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 52cc29603..5bac02c98 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -10,6 +10,7 @@ import Symbols._ import Contexts._ import Denotations._ import Types._ +import References.{Reference, SymRef, UniqueSymRef, OverloadedRef} import collection.mutable trait Symbols { self: Context => @@ -150,9 +151,11 @@ object Symbols { val initDenot = lastDenot.initial val newSym: Symbol = ctx.atPhase(FirstPhaseId) { implicit ctx => - def relink(ref: RefType): Symbol = ref match { - case ref: SymRef => ref.symbol - case OverloadedType(variants) => relink(variants(refType.signature)) + def relink(ref: Reference): Symbol = ref match { + case ref: SymRef => + if (ref.signature == thisRef.signature) ref.symbol else NoSymbol + case ref @ OverloadedRef(ref1, ref2) => + relink(ref1) orElse relink(ref2) } relink(initDenot.owner.info.decl(initDenot.name)) } @@ -169,7 +172,7 @@ object Symbols { def isType: Boolean def isTerm = !isType - def refType(implicit ctx: Context): SymRef = SymRef(owner.thisType, this) + def thisRef(implicit ctx: Context): SymRef = new UniqueSymRef(this, info) // forwarders for sym methods def owner(implicit ctx: Context): Symbol = deref.owner @@ -202,6 +205,9 @@ object Symbols { def isCovariant: Boolean = ??? def isContravariant: Boolean = ??? def isSkolem: Boolean = ??? + def isDeferred: Boolean = ??? + def isConcrete = !isDeferred + def isJava: Boolean = ??? def isSubClass(that: Symbol): Boolean = ??? def isNonBottomSubClass(that: Symbol): Boolean = ??? |