Skip to content

chore: clear MoonBit v0.10.6 diagnostics and bump CI toolchain pin - #68

Merged
brickfrog merged 2 commits into
mainfrom
chore/moonbit-0-10-6-warnings
Aug 7, 2026
Merged

chore: clear MoonBit v0.10.6 diagnostics and bump CI toolchain pin#68
brickfrog merged 2 commits into
mainfrom
chore/moonbit-0-10-6-warnings

Conversation

@brickfrog

Copy link
Copy Markdown
Owner

Housekeeping for the moonc v0.10.5 → v0.10.6 jump. No public surface change — the only .mbti delta is a trailing blank line dropped by the newer moon info (all 10 files show 0 1 in git diff --numstat).

Changes

E0082 ambiguous_braces — 31 sites

Empty {} now warns because it could be an empty map, block, struct literal, or JSON object. Every site was let x : Map[K, V] = {}Map([]), in otlp/types.mbt, otlp/convert.mbt, flame/flame.mbt, event.mbt, field.mbt, field_show.mbt, env_filter.mbt, span_json.mbt, span_observer.mbt, and id_test.mbt.

Left context.mbt:21 and filter.mbt:20 (ref.val = {}) alone — assignments to an already-typed Ref, not ambiguous, not flagged.

E0020 deprecated try? — 2 sites

Both were let result : Result[_, _] = try? f() immediately followed by guard result is Err(_) else { abort(…) }. The Result never escaped its expression, which is exactly the case the compiler says to rewrite:

try fail_in_scope() catch {
  _ => ()
} noraise {
  _ => abort("expected scoped failure")
}

CI toolchain pin

.github/scripts/setup-moonbit.sh was pinned to 0.10.5+5e7afb0c0, so CI would have verified this branch against a compiler predating the diagnostics it clears. Bumped to 0.10.6+80dc50f24 with recomputed SHA-256 digests for both the toolchain and core archives.

Verification

Ran the pinned installer locally, then the full CI matrix against the resulting isolated MOON_HOME (moonc v0.10.6+80dc50f24):

step result
moon check native / js / wasm-gc clean, 0 warnings
moon test --target native 293/293
moon test --target js 280/280
moon test --target wasm-gc 265/265
moon fmt then git diff no tracked file modified

Also confirmed the 0.10.6 tarball still ships bin/internal/tcc and still does not ship bin/moonx, so the script's chmod and ln -s moon bin/moonx lines remain correct.

Empty `{}` map literals now warn as ambiguous (E0082) and `try?` is
deprecated (E0020). Replace 31 `{}` literals with `Map([])` and rewrite the
two `try?` sites as `try ... catch ... noraise`, since neither bound
`Result` escaped its expression.

No public surface change: the only `.mbti` delta is a trailing blank line
dropped by the newer `moon info`.
The repo now builds against moonc v0.10.6; the pin was still on 0.10.5,
so CI would verify against a compiler that predates the diagnostics this
branch clears. SHA-256 digests recomputed for both archives.

Verified by running the pinned installer plus the full CI matrix (check
and test on native/js/wasm-gc, and the fmt check) against the resulting
isolated MOON_HOME.
@brickfrog
brickfrog merged commit d6cf55d into main Aug 7, 2026
1 check passed
@brickfrog
brickfrog deleted the chore/moonbit-0-10-6-warnings branch August 7, 2026 02:41
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