diff options
author | Martin Odersky <odersky@gmail.com> | 2015-06-16 16:12:45 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-16 16:42:54 +0200 |
commit | 4eb107258458801b72e5c34ab4ccf3729b9e12d6 (patch) | |
tree | 18f5c323209697b111182b287fdc5a00af3ba397 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | d25497a92f425c8966dce47cd17fba456ef2660f (diff) | |
download | dotty-4eb107258458801b72e5c34ab4ccf3729b9e12d6.tar.gz dotty-4eb107258458801b72e5c34ab4ccf3729b9e12d6.tar.bz2 dotty-4eb107258458801b72e5c34ab4ccf3729b9e12d6.zip |
Produce PureInterface flag together with NoInits flag
The previous stale symbol was discovered because NormalizeFlags looks
at all declarations of a MoInits trait in the SymTransformer. I.e it does
this for all no-init traits, whether loaded from a classfile or currently
compiled. This is wasteful because it forces too many definitions.
The new scheme drops the scan in favor of producing PureInterface
together with NoInits. PureInterface is already read as a flag from
Java snd Scala2 classfiles. For source and Tasty it is now generated
as members are indexed.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index fb26b2540..f4fde3e81 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -115,6 +115,12 @@ 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) + } + /** Has this denotation one of the flags in `fs` set? */ final def is(fs: FlagSet)(implicit ctx: Context) = { (if (fs <= FromStartFlags) myFlags else flags) is fs |