From 4eb107258458801b72e5c34ab4ccf3729b9e12d6 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 16 Jun 2015 16:12:45 +0200 Subject: 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. --- src/dotty/tools/dotc/transform/NormalizeFlags.scala | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/dotty/tools/dotc/transform/NormalizeFlags.scala') 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 } -- cgit v1.2.3