From bf8e854c9f2dc2b03be5a44c84183af21510e6ef Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 12 Mar 2013 09:04:57 +0100 Subject: 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. --- src/dotty/tools/dotc/core/Flags.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dotty/tools/dotc/core/Flags.scala') diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala index d846e4405..14f31a16d 100644 --- a/src/dotty/tools/dotc/core/Flags.scala +++ b/src/dotty/tools/dotc/core/Flags.scala @@ -61,6 +61,9 @@ object Flags { */ def is(flags: FlagConjunction, butNot: FlagSet): Boolean = is(flags) && !is(butNot) + /** Is this flag set a subset of that one? */ + def <= (that: FlagSet) = (bits & that.bits) == bits + /** This flag set with all flags transposed to be type flags */ def toTypeFlags = FlagSet(bits & ~KINDFLAGS | TYPES) @@ -349,6 +352,10 @@ object Flags { commonFlags(Private, Protected, Abstract, Final, Sealed, Case, Implicit, AbsOverride, Lazy) + /** Flags guaranteed to be set upon symbol creation */ + final val FromStartFlags = + AccessFlags | Module | Package | Deferred + /** Flags representing access rights */ final val AccessFlags = Private | Protected | Local -- cgit v1.2.3