From 5b4f154c9e4c2c6ff48ac68b8d984e306853328f Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 21 Mar 2013 21:30:30 +0100 Subject: More fixes to classfile reading. Can now read all classes in scala.collection.generic. Some failures remain for their companion objects. --- src/dotty/tools/dotc/core/Denotations.scala | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/dotty/tools/dotc/core/Denotations.scala') 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( -- cgit v1.2.3