Skip to content

refactor(quickcheck/splitmix): drop deprecated derive(Show) from RandomState - #4137

Merged
bobzhang merged 1 commit into
mainfrom
drop-splitmix-show-derive
Aug 24, 2026
Merged

refactor(quickcheck/splitmix): drop deprecated derive(Show) from RandomState#4137
bobzhang merged 1 commit into
mainfrom
drop-splitmix-show-derive

Conversation

@bobzhang

Copy link
Copy Markdown
Contributor

Summary

Removes derive(Show) — deprecated syntax — from RandomState, along with the #warnings("-deprecated_syntax") suppression and the #deprecated_syntax TODO comment. The Show instance was only ever used by doctest display smoke checks (rng.to_string().length() > 0), so derive(@debug.Debug) alone suffices.

Changes

  • random.mbt: derive(Show, @debug.Debug)derive(@debug.Debug); drop suppression + TODO.
  • extends.mbt: remove the promoted Show::{to_string} extend and the deprecated hidden Show::{output} extend (both required the Show impl).
  • README.mbt.md: replace the weak inspect(x.to_string().length() > 0, content="true") smoke checks with debug_inspect snapshots of the deterministic seeded values (generated via moon test --update).
  • pkg.generated.mbti: regenerated with moon infopub impl Show and RandomState::to_string are gone from the public interface.

Validation

  • moon check (module-wide): clean.
  • moon test quickcheck/splitmix: 19/19 passed (includes updated README doctests).
  • moon test quickcheck: 82/82 passed.
  • moon fmt --check quickcheck: clean.

Note: removing RandomState::to_string() / the Show impl is a breaking change for any external caller relying on them; this is the migration the prior TODO anticipated.

Generated with SeekMoon

Copilot AI lite review requested due to automatic review settings August 24, 2026 05:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the deprecated derive(Show) implementation from quickcheck/splitmix.RandomState and updates the package surface/documentation accordingly, standardizing on @debug.Debug for display/snapshot use and regenerating the public interface.

Changes:

  • Remove Show derivation (and the deprecated-syntax warning suppression) from RandomState.
  • Remove Show-related extend promotions/deprecations from extends.mbt.
  • Replace README doctest “string length smoke checks” with deterministic debug_inspect snapshots and regenerate pkg.generated.mbti to reflect the new public API.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
quickcheck/splitmix/random.mbt Drops deprecated derive(Show) and the deprecated-syntax suppression, leaving derive(@debug.Debug).
quickcheck/splitmix/extends.mbt Removes Show-based promoted/hidden extensions now that RandomState no longer implements Show.
quickcheck/splitmix/README.mbt.md Updates doctests from to_string() smoke checks to deterministic debug_inspect snapshots.
quickcheck/splitmix/pkg.generated.mbti Regenerated interface reflecting removal of Show derivation and RandomState::to_string.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…omState

`derive(Show)` is deprecated syntax. Remove it (and the `#warnings` suppression) from RandomState, keeping `derive(@debug.Debug)`; the Show impl was only exercised by doctest display smoke checks. Replace those with `debug_inspect` snapshots of the deterministic seeded values.

Co-Authored-By: SeekMoon <noreply@moonbitlang.cn>
@bobzhang
bobzhang force-pushed the drop-splitmix-show-derive branch from 1eea9b1 to f1b7156 Compare August 24, 2026 05:58
@coveralls

coveralls commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 6311

Coverage remained the same at 90.885%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 18421
Covered Lines: 16742
Line Coverage: 90.89%
Coverage Strength: 306998.62 hits per line

💛 - Coveralls

@bobzhang
bobzhang merged commit dae731c into main Aug 24, 2026
20 checks passed
@bobzhang
bobzhang deleted the drop-splitmix-show-derive branch August 24, 2026 06:25
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.

3 participants