Conversation
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8689 +/- ##
==========================================
+ Coverage 78.67% 78.71% +0.03%
==========================================
Files 476 476
Lines 64402 64413 +11
==========================================
+ Hits 50670 50704 +34
+ Misses 13732 13709 -23
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8689 |
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24646c5cb8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| else if not (Lam_closure.is_closed lambda) then | ||
| Location.raise_errorf ~loc | ||
| "@inline(crossModule) requires a function without captured local \ | ||
| values" |
There was a problem hiding this comment.
Treat catch binders as local during inline validation
For an exported @inline(crossModule) function containing a try ... catch whose handler inspects the exception, this check incorrectly rejects the function as capturing a local value. Lam_closure.is_closed delegates to free_variables, but its Ltrywith branch ignores _exn instead of adding that binder to the local set (compiler/core/lam_closure.ml:118-120), so ordinary references to the caught exception are reported as free. Register the catch binder during closure traversal or use validation that handles all Lambda binders.
AGENTS.md reference: AGENTS.md:L51-L54
Useful? React with 👍 / 👎.
Add
@inline(crossModule)to opt individual functions into cross-module inlining, and use it for selectedOptionhelpers.Inlining copies a function’s body into its callers. If that body changes but its type does not, the caller must still be rebuilt; checking only the
.cmitype signature would leave the old body in the generated JavaScript.The compiler stores exported inline bodies in the existing
.cmjfile, alongside other JavaScript compilation metadata. Rewatch now compares the digest already stored in that file’s header before and after compiling a module. If it changes, Rewatch rebuilds dependents. This keeps implementation details out of.cmiand requires no new artifact. A.cmjchange unrelated to inlining may also cause a dependent rebuild.