Skip to content

Commit c452fbd

Browse files
committed
fix error in optimisation
We need to ensure that the order of the fields and the arguements match.
1 parent 5290620 commit c452fbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/transform/localopt/InlineLocalObjects.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class InlineLocalObjects(val simplifyPhase: Simplify) extends Optimisation {
8989
initNewFieldsMapping();
9090
{
9191
case t @ NewCaseClassValDef(fun, args) if newFieldsMapping.contains(t.symbol) =>
92-
val newFields = newFieldsMapping(t.symbol).values.toList
92+
val newFields = newFieldsMapping(t.symbol).values.toList.sortBy(_.name.show)
9393
val newFieldsDefs = newFields.zip(args).map { case (nf, arg) =>
9494
val rhs = arg.changeOwnerAfter(t.symbol, nf.symbol, simplifyPhase)
9595
ValDef(nf.asTerm, rhs)

0 commit comments

Comments
 (0)