Skip to content

chore: clear MoonBit deprecation warnings (5 → 0 warnings) - #9

Merged
bobzhang merged 1 commit into
mainfrom
chore/moonbit-deprecation-sweep
Sep 7, 2026
Merged

bobzhang merged 1 commit into
mainfrom
chore/moonbit-deprecation-sweep

Conversation

@bobzhang

@bobzhang bobzhang commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Brings moonbit-community/qrc up to date with the current MoonBit toolchain (moon 0.1.20260901). This repo publishes 1 module on mooncakes.io.

Result

before after
Warning sites 5 0
Compile errors 0 0

Tests: 23/23 passed (baseline before edits: 23/23 passed, 0 failed) — no regressions, no snapshot updates needed

What changed

  • [0079] implicit_impl_as_method x4 - added explicit pub extend T with Eq::{not_equal, equal} declarations for ErrorCorrectionLevel (qrc.mbt:9), Mode (qrc.mbt:19), Module (qrc.mbt:32) and MaskPattern (qrc.mbt:1027), making the previously-implicit promotion of derived Eq methods explicit
  • [0020] deprecated x1 - qrc.mbt:57 Array::new(capacity=size) -> Array(capacity=size) in new_matrix (only Array::new site in the repo)
  • moon.mod.json -> moon.mod migration performed automatically by moon fmt (the deprecated JSON module-metadata format was removed by the tool); content carried over faithfully
  • main/moon.pkg options("is-main": true) -> pkgtype(kind: "executable"), rewritten automatically by moon fmt

Knowingly left alone

  • unnecessary_annotation [0073] (opt-in only, NOT in default moon check) (129): Only surfaces under moon check --warn-list +unnecessary_annotation; it is off by default, was not in the 5-warning baseline, and default moon check is now at 0 warnings. These are over-qualified enum constructor...

Reviewer notes

All numbers are measured from real command runs, not estimates. VERIFICATION - Final moon check --output-json: 0 warnings, 0 errors (exit 0). Also clean on all four backends checked individually: wasm-gc, wasm, js, native. - moon test: 23/23 passed both before and after. Baseline was recorded before any edit, so no pre-existing failure was misattributed. - moon build succeeds and moon run main still renders a correct QR code (Version 2, 25x25, Byte mode, EC level M) — this also sanity-checks the pkgtype(kind: "executable") rewrite in main/moon.pkg. - No #warnings("-...") suppressions, no deleted tests, no weakened assertions, no #deprecated escape hatches. Nothing under .mooncakes/ was touched. PUBLIC API / mbti CHANGES (pkg.generated.mbti) - pkg.generated.mbti gains 8 explicit lines — equal/not_equal for each of ErrorCorrectionLevel, MaskPattern, Mode, Module. This is a declaration of what was already there, not a new capability: these methods were previously being promoted implicitly by the compiler (which is exactly what warning 0079 was reporting), so every call site that compiled before still compiles. The extend form was chosen over per-type manual methods, and over #deprecated-ing the promotion, because bobzhang/qrc is a published mooncakes.io module and external consumers may call x.equal(y) in dot form. I confirmed there are zero .equal( ...

How this was verified

  • Baseline and final counts are from moon check --output-json, deduplicated by (file, location, code), re-measured independently after the changes were made.
  • No warning was silenced to reach these numbers: the diff adds no #warnings("-..."), alert-list or warn-list escapes.
  • Test snapshots were reviewed rather than blind-accepted; where a suite already failed, that was confirmed against a clean HEAD.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Yc3P6APF111hdbCXRT4M3P

Updates moonbit-community/qrc for the current MoonBit toolchain (moon 0.1.20260901).

Warning sites: 5 -> 0. Compile errors: 0 -> 0.

No warnings were suppressed; counts come from moon check --output-json
deduplicated by (file, location, code).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Yc3P6APF111hdbCXRT4M3P
@bobzhang
bobzhang merged commit eaa2554 into main Sep 7, 2026
2 checks passed
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.

1 participant