Repository navigation
Conversation
Changelog💅 Polish
Semantic Diff1 commit · Full page ✏️ Inline other modules' functions called through a variable9d227df · cknitt + Claude · Dec 05, 2026, 10:14 UTC · edited
JS modified ( let orEmpty = (x: option<string>) => {
let {getOr} = module(Option)
x->getOr("")
}
function orEmpty(x) {
- return Stdlib_Option.getOr(x, "");
+ if (x !== undefined) {
+ return x;
+ } else {
+ return "";
+ }
}JS modified (a top-level let getOr = Option.getOr
let orZero = (x: option<int>) => x->getOr(0)
function orZero(x) {
- return Stdlib_Option.getOr(x, 0);
+ if (x !== undefined) {
+ return x;
+ } else {
+ return 0;
+ }
}Review
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
a0e9b0b to
f4299ac
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## inline-assigned-cleanup #9539 +/- ##
========================================================
Coverage 82.63% 82.63%
========================================================
Files 469 469
Lines 66585 66593 +8
========================================================
+ Hits 55021 55029 +8
Misses 11564 11564
🚀 New features to boost your workflow:
|
✅ Compiler benchmarksAllocated wordsIn total: 660,462,564 → 660,608,442 (+0.02%). Generated projects: 628,088,036 → 628,248,539 (+0.03%).
8 more changes
InstructionsIn total: 8,945,560,836 → 8,946,887,495 (+0.01%).
Output sizeIn total: 27,764,252 → 27,764,662 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request 9d227df compared with base 24e1c7b in this run. |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
f4299ac to
9141ac7
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
9983141 to
b37eb36
Compare
Why:
Since the late inlining went, a call through a variable bound to
another module's function, as in `let f = M.f` or
`let {f} = module(M)`, was compiled as a call even when `M.f` is
`@inline`. The alias pass now remembers which variables are bound to
a field of another module and calls that field directly, so the
existing case for other modules' functions inlines it. This works
for top-level and local bindings alike.
JS modified (`let {f} = module(M)` in a function):
Example:
let orEmpty = (x: option<string>) => {
let {getOr} = module(Option)
x->getOr("")
}
Before (js):
function orEmpty(x) {
return Stdlib_Option.getOr(x, "");
}
After (js):
function orEmpty(x) {
if (x !== undefined) {
return x;
} else {
return "";
}
}
JS modified (a top-level `let f = M.f`):
Example:
let getOr = Option.getOr
let orZero = (x: option<int>) => x->getOr(0)
Before (js):
function orZero(x) {
return Stdlib_Option.getOr(x, 0);
}
After (js):
function orZero(x) {
if (x !== undefined) {
return x;
} else {
return 0;
}
}
Review: What does `inline_through_alias_test` cover? The three shapes,
`let f = M.f`, `let {f} = module(M)` and a local `let f = M.f`, each
with `Option` functions that inline, and a call whose arguments must
still run in order. `hello_res.mjs` is back to its output on master,
where `u` is neither exported nor used, so only the `length` call
remains.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gHZYwA1rq7zbk3dhQq
Signed-off-by: Christoph Knittel <ck@cca.io>
b37eb36 to
9d227df
Compare
Since late inlining went (PR below), a call through a variable bound to another module's function was compiled as a call, even when that function is
@inline. The alias pass now remembers variables bound to a field of another module and calls that field directly, so the existing case for other modules' functions inlines it.let {f} = module(M)in a function:Before:
After:
A top-level
let f = M.f:Before:
After:
New test
inline_through_alias_testcovers these shapes, a locallet f = M.f, and the order of arguments.hello_res.mjsis back to its output on master.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gHZYwA1rq7zbk3dhQq