diff options
author | Martin Odersky <odersky@gmail.com> | 2013-03-12 09:04:57 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-03-12 09:04:57 +0100 |
commit | bf8e854c9f2dc2b03be5a44c84183af21510e6ef (patch) | |
tree | d9e59bd6415405b93662adce334d87c626c38980 /src/dotty/tools/dotc/core/Types.scala | |
parent | f02b4183a9a3d8fb7147e1aa1c74a5f102739d97 (diff) | |
download | dotty-bf8e854c9f2dc2b03be5a44c84183af21510e6ef.tar.gz dotty-bf8e854c9f2dc2b03be5a44c84183af21510e6ef.tar.bz2 dotty-bf8e854c9f2dc2b03be5a44c84183af21510e6ef.zip |
Split filterAsSeenFrom and generalized flag handling.
1. filterAsSeenFrom has been split again into its constituents "filterExcluded" and "asSeenFrom", and care was taken not to force the info unless we have to. The accessible check is no longer done when collecting members, because it would have forced the symbol through requesting privateWithin.
2. SymDenotation#is is tweaked to no longer force the denotation if the flags are in "FromStartFlags", i.e. set upon symbol creation. We can then eliminate special cases isModuleXXX, isPackageXXX.
3. Other tweaks mostly having to do with weakening sym.exists checks to avoid CyclicReference errros.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index b8993f71c..80a56d76b 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -88,7 +88,7 @@ object Types { * be refined later. */ final def isNotNull(implicit ctx: Context): Boolean = - widen.typeSymbol.isModuleClass + widen.typeSymbol is ModuleClass /** Is this type produced as a repair for an error? */ final def isError(implicit ctx: Context): Boolean = @@ -227,7 +227,7 @@ object Types { */ final def findDecl(name: Name, excluded: FlagSet)(implicit ctx: Context): Denotation = this match { case tp: ClassInfo => - tp.decls.denotsNamed(name).filterAsSeenFrom(NoPrefix, excluded).toDenot + tp.decls.denotsNamed(name).filterExcluded(excluded).toDenot case tp: TypeProxy => tp.underlying.findDecl(name, excluded) } @@ -256,7 +256,7 @@ object Types { tp.underlying.findMember(name, pre, excluded) case tp: ClassInfo => val candidates = tp.cls.membersNamed(name) - candidates.filterAsSeenFrom(pre, excluded).toDenot + candidates.filterExcluded(excluded).asSeenFrom(pre).toDenot case AndType(l, r) => l.findMember(name, pre, excluded) & r.findMember(name, pre, excluded) case OrType(l, r) => |