Skip to content

Propagate partial calls with checked arguments - #626

Open
LPTK wants to merge 2 commits into
hkust-taco:hkmc2from
LPTK:codex/pr575-partial-call-arguments
Open

LPTK wants to merge 2 commits into
hkust-taco:hkmc2from
LPTK:codex/pr575-partial-call-arguments

Conversation

@LPTK

@LPTK LPTK commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

[GPT-6 Astra]

Checked or effectful arguments currently stop a partial application from propagating into its later application. Evaluate them once at the original call site, in source order, leaving a pure call prefix that can combine and inline. Earlier arguments are snapshotted too, because later arguments can mutate the locals they read.

This is E20 from #575: 24 added Scala lines in one file. Tests cover checked prefixes, once-only getters, evaluation order across arguments and curried lists, and discarded Wasm partial applications. The ordering regressions reject a variant that hoists only the last effectful argument.

Targets current hkmc2 independently of #575 and the other extraction PRs.

codex added 2 commits November 6, 2026 23:54
Evaluate checked and effectful arguments at the partial-call site so the remaining pure call can propagate and inline. Snapshot preceding arguments before later effects, including across supplied curried lists.

Add regression coverage for checked prefixes, once-only getters, argument order, and discarded Wasm partial applications. The ordering regressions reject a variant that hoists only the final effectful argument.

Validation: Metals compilation, ctest, cwtest, focused diff tests, and hkmc2AllTests/test (1,285 tests).
Validation: Metals compilation and hkmc2AllTests/test (1,288 tests).
@LPTK

LPTK commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Note to self: this seems very fishy and will need a closer look and probably a more general solution. Likely related to #571.

This branch has not been deployed

No deployments
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.

2 participants