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/transform/NormalizeFlags.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/transform/NormalizeFlags.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/NormalizeFlags.scala | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/transform/NormalizeFlags.scala b/src/dotty/tools/dotc/transform/NormalizeFlags.scala index 2f5907b75..755846904 100644 --- a/src/dotty/tools/dotc/transform/NormalizeFlags.scala +++ b/src/dotty/tools/dotc/transform/NormalizeFlags.scala @@ -19,12 +19,7 @@ class NormalizeFlags extends MiniPhaseTransform with SymTransformer { thisTransf def transformSym(ref: SymDenotation)(implicit ctx: Context) = { var newFlags = ref.flags &~ Local - if (ref.is(NoInitsTrait) && ref.info.decls.forall(isPureInterfaceMember)) - newFlags |= PureInterface if (newFlags != ref.flags) ref.copySymDenotation(initFlags = newFlags) else ref } - - private def isPureInterfaceMember(sym: Symbol)(implicit ctx: Context) = - if (sym.isTerm) sym.is(Deferred) else !sym.isClass } |