• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 5551 / 1
91%
main: 91%

Build:
DEFAULT BRANCH: main
Ran 25 Jul 2026 08:34AM UTC
Files 444
Run time 8s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Jul 2026 08:33AM UTC coverage: 91.271% (+0.001%) from 91.27%
5551.1

push

github

bobzhang
feat(builtin): add `Json(x)` constructor for any `ToJson` value

`Json::Json` converts any `ToJson` value into a `Json`. Being the constructor of
`Json`, it is written `Json(x)`, and because the prelude already re-exports
`type Json` the constructor travels with it — so `Json(x)` works from every
package with no import, `builtin` included.

This gives JSON conversion a single short spelling that is reachable everywhere:

  Json(x)              // anywhere, no import
  @json.to_json(x)     // needs @json; unreachable from builtin (cycle)
  ToJson::to_json(x)   // verbose, implementer-flavored

It composes with `Json`'s literal sugar — `([x, y] : Json)` for literals,
`Json(x)` for conversions — and it is spelled the same regardless of which
package `Json` lives in, so a future move of `Json`/`ToJson` to `@json` would not
churn call sites (the same property `to_repr(x)` has while `Debug`/`Repr` live in
`@debug`).

AGENTS.md records `Json(x)` as the replacement for the promoted `x.to_json()`
method, which unblocks deprecating that promotion in a follow-up.

Verified: `moon check --deny-warn --target all` clean; `moon test --target all`
green (6783/6783/6739/6694); `.mbti` gains only the new constructor.

15914 of 17436 relevant lines covered (91.27%)

188693.07 hits per line

Source Files on job 5551.1
  • Tree
  • List 444
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5551
  • 841c1ec7 on github
  • Prev Job for on main (#5549.1)
  • Next Job for on main (#5554.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc