Skip to content

Commit 24c79c2

Browse files
committed
Fix #4947: Retain the structure of PreTransRecordTree.
Instead of only retaining the `RecordType`. The `structure` contains the complete information required to map `FieldName`s to the record's `SimpleFieldName`s.
1 parent 4878731 commit 24c79c2

File tree

3 files changed

+192
-135
lines changed

3 files changed

+192
-135
lines changed

linker/shared/src/main/scala/org/scalajs/linker/frontend/optimizer/IncOptimizer.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,13 @@ final class IncOptimizer private[optimizer] (config: CommonPhaseConfig, collOps:
804804
None
805805
} else {
806806
val allFields = computeAllInstanceFieldDefs()
807-
Some(new OptimizerCore.InlineableClassStructure(allFields))
807+
Some(new OptimizerCore.InlineableClassStructure(className, allFields))
808808
}
809809

810-
tryNewInlineable != oldTryNewInlineable
810+
(tryNewInlineable, oldTryNewInlineable) match {
811+
case (Some(n), Some(o)) => !n.sameStructureAs(o)
812+
case _ => tryNewInlineable != oldTryNewInlineable
813+
}
811814
}
812815

813816
/** UPDATE PASS ONLY, used by `computeInlineableFieldBodies` and `updateTryNewInlineable`. */

0 commit comments

Comments
 (0)