aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Denotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-21 21:30:30 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-21 21:30:30 +0100
commit5b4f154c9e4c2c6ff48ac68b8d984e306853328f (patch)
treeb79b81c86c31a7b6b6b34801dc81346413e5a699 /src/dotty/tools/dotc/core/Denotations.scala
parent5ac2104e688409e24785cfe62cdc7e8ef0bc6428 (diff)
downloaddotty-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.scala22
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(