aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-16 16:27:10 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-16 16:42:54 +0200
commit112f39aa1c3a9e36848b30d7d2709fb1b2ef7949 (patch)
tree5f61e94cc0b8684808431fd6424063907d0690eb /src/dotty/tools/dotc/core/SymDenotations.scala
parent4eb107258458801b72e5c34ab4ccf3729b9e12d6 (diff)
downloaddotty-112f39aa1c3a9e36848b30d7d2709fb1b2ef7949.tar.gz
dotty-112f39aa1c3a9e36848b30d7d2709fb1b2ef7949.tar.bz2
dotty-112f39aa1c3a9e36848b30d7d2709fb1b2ef7949.zip
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.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala10
1 files changed, 5 insertions, 5 deletions
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) = {