diff options
author | Martin Odersky <odersky@gmail.com> | 2013-03-21 21:30:30 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-03-21 21:30:30 +0100 |
commit | 5b4f154c9e4c2c6ff48ac68b8d984e306853328f (patch) | |
tree | b79b81c86c31a7b6b6b34801dc81346413e5a699 /src/dotty/tools/dotc/core/Denotations.scala | |
parent | 5ac2104e688409e24785cfe62cdc7e8ef0bc6428 (diff) | |
download | dotty-5b4f154c9e4c2c6ff48ac68b8d984e306853328f.tar.gz dotty-5b4f154c9e4c2c6ff48ac68b8d984e306853328f.tar.bz2 dotty-5b4f154c9e4c2c6ff48ac68b8d984e306853328f.zip |
More fixes to classfile reading.
Can now read all classes in scala.collection.generic. Some failures remain for their companion objects.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 24008ab63..f8837fafe 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -463,15 +463,25 @@ object Denotations { final def first = this final def toDenot(implicit ctx: Context) = this final def containsSig(sig: Signature)(implicit ctx: Context) = - signature == sig + exists && signature == sig final def filterDisjoint(denots: PreDenotation)(implicit ctx: Context): SingleDenotation = if (denots.containsSig(signature)) NoDenotation else this final def filterExcluded(excluded: FlagSet)(implicit ctx: Context): SingleDenotation = - if (excluded != EmptyFlags && (asSymDenotation is excluded)) NoDenotation - else this - def asSeenFrom(pre: Type)(implicit ctx: Context): SingleDenotation = - if (!asSymDenotation.owner.membersNeedAsSeenFrom(pre)) this - else derivedSingleDenotation(symbol, info.asSeenFrom(pre, asSymDenotation.owner)) + if (excluded == EmptyFlags) this + else this match { + case thisd: SymDenotation => + if (thisd is excluded) NoDenotation else this + case _ => + if (symbol is excluded) NoDenotation else this + } + def asSeenFrom(pre: Type)(implicit ctx: Context): SingleDenotation = { + val owner = this match { + case thisd: SymDenotation => thisd.owner + case _ => if (symbol.exists) symbol.owner else NoSymbol + } + if (!owner.membersNeedAsSeenFrom(pre)) this + else derivedSingleDenotation(symbol, info.asSeenFrom(pre, owner)) + } } class UniqueRefDenotation( |