Repository navigation
Preserve constructor behavior and ordered matches during fusion - #627
Merged
Merged
Conversation
Validation: Metals compilation and hkmc2AllTests/test (1,288 tests).
This was referenced Nov 7, 2026
Member
|
Looks good to me, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[GPT-6 Astra]
Constructor elimination and fusion can currently drop superclass effects, substitute the original argument after a constructor changes its field, crash on optional-field layouts, or select an incorrect match arm. Check the current IR constructor and its superclass chain before skipping construction, validate the parameter-to-field mapping before field fusion, and share an ordered producer-aware branch decision between fusion eligibility and rewriting.
Default-branch closures retain producer-specific field layouts. Regressions cover the four failures above, tuple/Array/Object matching, differing default-branch arities, lifted captures, and safe elimination of pure constructors.
This is E21–E23 from #575: 170 changed Scala lines across three files, plus regressions and regenerated goldens. It targets current
hkmc2independently of #575 and the other extraction PRs.If integrating after #575, remove its E21–E23
:fixmes inslop/Erasure.mlsandslop/strictres/OptionalBinding.mls. The deforestation follow-up #624 has additional E21–E23 markers to reconcile if it has also landed. Preserve the assertions and regenerate shared goldens.