Skip to content

Keep fused values compatible with container field storage - #628

Merged
LPTK merged 3 commits into
hkust-taco:hkmc2from
LPTK:codex/pr575-fusion-storage
Nov 10, 2026
Merged

LPTK merged 3 commits into
hkust-taco:hkmc2from
LPTK:codex/pr575-fusion-storage

Conversation

@LPTK

@LPTK LPTK commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

[GPT-6 Astra]

A constructor stored in a surviving object's nominally typed field must keep a representation that fits that field. Match fusion can otherwise replace it with a closure, producing invalid storage and Wasm failures.

Propagate the need to keep a constructor unfused through its stored producers when their replacement would not fit the field. Fields with the top representation still admit match closures; unconsumed containers also seed the exclusion graph. Keep field-projection fusion conservative at storage boundaries.

This is E24 from #575: 40 changed Scala lines across four files, plus JS and Wasm regressions and regenerated goldens. It targets current hkmc2 independently of #575 and the constructor-safety extraction.

When integrating with the deforestation follow-up #624, remove its E24 :fixme in deforest/erasedTypes.mls, retain the assertion, and regenerate shared goldens.

@ychenfo

ychenfo commented Nov 9, 2026

Copy link
Copy Markdown
Member

The changes appear to be extraction of the first bullet point of LPTK#33 and it look fine to me, thanks!

@LPTK
LPTK merged commit eb82fad into hkust-taco:hkmc2 Nov 10, 2026
1 check passed
@LPTK
LPTK deleted the codex/pr575-fusion-storage branch November 10, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants