File tree 1 file changed +3
-2
lines changed
compiler/src/dotty/tools/dotc/transform
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ class MoveStatics extends MiniPhase with SymTransformer {
34
34
override def transformStats (trees : List [Tree ])(implicit ctx : Context ): List [Tree ] = {
35
35
if (ctx.owner.is(Flags .Package )) {
36
36
val (classes, others) = trees.partition(x => x.isInstanceOf [TypeDef ] && x.symbol.isClass)
37
- val pairs = classes.groupBy(_.symbol.name.stripModuleClassSuffix).asInstanceOf [Map [Name , List [TypeDef ]]]
37
+ // TODO make a groupBy that builds linked maps
38
+ val pairs = classes.groupBy(_.symbol.name.stripModuleClassSuffix).asInstanceOf [Map [Name , List [TypeDef ]]].toList.sortBy(_._1.toString)
38
39
39
40
def rebuild (orig : TypeDef , newBody : List [Tree ]): Tree = {
40
41
if (orig eq null ) return EmptyTree
@@ -73,7 +74,7 @@ class MoveStatics extends MiniPhase with SymTransformer {
73
74
if (classes.head.symbol.is(Flags .Module )) move(classes.head, null )
74
75
else List (rebuild(classes.head, classes.head.rhs.asInstanceOf [Template ].body))
75
76
else move(classes.head, classes.tail.head)
76
- Trees .flatten(newPairs.toList. flatten ++ others)
77
+ Trees .flatten(newPairs.flatten ++ others)
77
78
} else trees
78
79
}
79
80
}
You can’t perform that action at this time.
0 commit comments