From 112f39aa1c3a9e36848b30d7d2709fb1b2ef7949 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 16 Jun 2015 16:27:10 +0200 Subject: Use FlagSet directly instead of defKind Instead of classifying class members with a TreeInfo.DefKind, we use directly the flags into which kinds were previously translated. --- src/dotty/tools/dotc/core/SymDenotations.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala') diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index f4fde3e81..6d8d6a8f0 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -115,11 +115,11 @@ object SymDenotations { /** Unset given flags(s) of this denotation */ final def resetFlag(flags: FlagSet): Unit = { myFlags &~= flags } - final def setFlagsFromDefKind(kind: TreeInfo.DefKind): Unit = - if (kind >= TreeInfo.NoInitDef) { - setFlag(NoInits) - if (kind == TreeInfo.InterfaceDef && myFlags.is(Trait)) setFlag(PureInterface) - } + /** Set applicable flags from `flags` which is a subset of {NoInits, PureInterface} */ + final def setApplicableFlags(flags: FlagSet): Unit = { + val mask = if (myFlags.is(Trait)) NoInitsInterface else NoInits + setFlag(flags & mask) + } /** Has this denotation one of the flags in `fs` set? */ final def is(fs: FlagSet)(implicit ctx: Context) = { -- cgit v1.2.3