Skip to content

[codex] apply callback sugar project-wide#367

Merged
bobzhang merged 1 commit into
mainfrom
codex/project-wide-callback-sugar
May 15, 2026
Merged

[codex] apply callback sugar project-wide#367
bobzhang merged 1 commit into
mainfrom
codex/project-wide-callback-sugar

Conversation

@Yoorkin
Copy link
Copy Markdown

@Yoorkin Yoorkin commented May 15, 2026

Summary

  • Apply <| callback sugar throughout src for positional callbacks passed as the final argument.
  • Wrap expression-bodied callbacks in block closures where needed so they parse after <|.
  • Leave forms that cannot use the sugar cleanly, such as labeled callbacks, non-final callbacks, and method-chain cases that do not type-check with method() <|.

Validation

  • moon fmt
  • moon fmt --manifest-path src/process/test_programs/moon.mod.json
  • moon check
  • moon check --target wasm --deny-warn
  • moon check --target js --deny-warn
  • moon test (first post-fix run hit timing-sensitive fs/lock_test ordering assertions; rerun passed 488/488)

@bobzhang bobzhang force-pushed the codex/project-wide-callback-sugar branch from 47ea17a to dede4b7 Compare May 15, 2026 01:55
@coveralls
Copy link
Copy Markdown

coveralls commented May 15, 2026

Coverage Report for CI Build 301

Coverage increased (+0.02%) to 78.548%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 8 uncovered changes across 5 files (85 of 93 lines covered, 91.4%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
src/internal/event_loop/event_loop.mbt 6 3 50.0%
src/signal/signal.mbt 2 0 0.0%
src/js_async/js_async.mbt 7 6 85.71%
src/process/process.mbt 29 28 96.55%
src/tls/openssl.mbt 1 0 0.0%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/process/process.mbt 1 96.83%

Coverage Stats

Coverage Status
Relevant Lines: 4186
Covered Lines: 3288
Line Coverage: 78.55%
Coverage Strength: 59504.53 hits per line

💛 - Coveralls

@bobzhang bobzhang marked this pull request as ready for review May 15, 2026 01:57
@bobzhang bobzhang merged commit 3568d34 into main May 15, 2026
28 of 29 checks passed
@bobzhang bobzhang deleted the codex/project-wide-callback-sugar branch May 15, 2026 02:05
err => {
log.push("put() cancelled")
raise err
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a moon fmt bug. cc @Yoorkin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants