File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -606,6 +606,7 @@ object Flags {
606
606
final val AbstractFinal = allOf(Abstract , Final )
607
607
final val AbstractSealed = allOf(Abstract , Sealed )
608
608
final val SyntheticArtifact = allOf(Synthetic , Artifact )
609
+ final val SyntheticModule = allOf(Synthetic , Module )
609
610
final val SyntheticTermParam = allOf(Synthetic , TermParam )
610
611
final val SyntheticTypeParam = allOf(Synthetic , TypeParam )
611
612
final val SyntheticCase = allOf(Synthetic , Case )
Original file line number Diff line number Diff line change @@ -26,10 +26,12 @@ class DropEmptyCompanions extends MiniPhase { thisTransform =>
26
26
27
27
/** Is `tree` an empty companion object? */
28
28
private def isEmptyCompanion (tree : Tree )(implicit ctx : Context ) = tree match {
29
- case TypeDef (_, impl : Template ) =>
30
- tree.symbol.is(Module ) &&
29
+ case TypeDef (_, impl : Template ) if
30
+ tree.symbol.is(SyntheticModule ) &&
31
31
tree.symbol.companionClass.exists &&
32
- impl.body.forall(_.symbol.isPrimaryConstructor)
32
+ impl.body.forall(_.symbol.isPrimaryConstructor) =>
33
+ // println(i"removing ${tree.symbol}")
34
+ true
33
35
case _ =>
34
36
false
35
37
}
You can’t perform that action at this time.
0 commit comments