Skip to content

Commit 55c6d08

Browse files
committed
Make elimWildcardIdents apply to Assignments
Fixes junit failure in dotty where a lazy val was initialized with a "...$lazy = _" assignment. Moved ElimWiildcard to one group before. It does not really matter where it goes so it might as well go someshere in the middle of the pack.
1 parent b90584c commit 55c6d08

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/dotty/tools/dotc/Compiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ class Compiler {
7171
List(new LambdaLift, // in this mini-phase block scopes are incorrect. No phases that rely on scopes should be here
7272
new Flatten,
7373
new ElimStaticThis,
74+
new ElimWildcardIdents,
7475
new RestoreScopes),
7576
List(/*new PrivateToStatic,*/
7677
new ExpandPrivate,
7778
new CollectEntryPoints,
7879
new LabelDefs,
79-
new ElimWildcardIdents,
8080
new TraitConstructors),
8181
List(new GenBCode)
8282
)

src/dotty/tools/dotc/transform/ElimWildcardIdents.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class ElimWildcardIdents extends MiniPhaseTransform {
2929
recur(tree)
3030
}
3131

32+
override def transformAssign(tree: tpd.Assign)(implicit ctx: Context, info: TransformerInfo): tpd.Tree =
33+
cpy.Assign(tree)(tree.lhs, wildcardToDefaultValue(tree.rhs))
34+
3235
override def transformValDef(tree: tpd.ValDef)(implicit ctx: Context, info: TransformerInfo): tpd.Tree =
3336
cpy.ValDef(tree)(rhs = wildcardToDefaultValue(tree.rhs))
3437

0 commit comments

Comments
 (0)