Skip to content

feat(string/internal/regex_engine): make trait promotions explicit via extend#3885

Merged
bobzhang merged 1 commit into
mainfrom
hongbo/extend-string-internal-regex_engine
Jul 23, 2026
Merged

feat(string/internal/regex_engine): make trait promotions explicit via extend#3885
bobzhang merged 1 commit into
mainfrom
hongbo/extend-string-internal-regex_engine

Conversation

@bobzhang

Copy link
Copy Markdown
Contributor

Summary

Part of the per-package series migrating moonbitlang/core off implicit trait-method promotion (see #3849 for deque). Covers string/internal/regex_engine only.

The compiler flags only @debug.Debug for the MatchResult type, deprecated (no promotions).

Deprecations carry #doc(hidden), so pkg.generated.mbti gains only the promoted methods. Scoped to string/internal/regex_engine/.

Verification

  • moon check --deny-warn --target all — clean.
  • moon test -p moonbitlang/core/string/internal/regex_engine --target all — green.

Signed-off-by: Codex CLI <codex@openai.com>

Copilot AI review requested due to automatic review settings July 22, 2026 11:39

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 continues the per-package migration away from implicit trait-method promotion for moonbitlang/core, scoped specifically to string/internal/regex_engine, by enabling the warning and making the remaining promotion surface explicit via an extends.mbt shim (deprecated + hidden from the generated interface).

Changes:

  • Enable +implicit_impl_as_method warnings for the string/internal/regex_engine package.
  • Add extends.mbt to explicitly (but deprecated) extend MatchResult with @debug.Debug::{to_repr} while keeping it hidden from the generated interface.

Reviewed changes

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

File Description
string/internal/regex_engine/moon.pkg Enables the implicit trait-method promotion warning for this package.
string/internal/regex_engine/extends.mbt Adds an explicit deprecated extend for MatchResult.to_repr to avoid relying on implicit promotion while keeping it out of the generated interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls

coveralls commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 5452

Coverage remained the same at 91.293%

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: 17400
Covered Lines: 15885
Line Coverage: 91.29%
Coverage Strength: 189079.48 hits per line

💛 - Coveralls

@bobzhang
bobzhang enabled auto-merge (rebase) July 23, 2026 01:58
@bobzhang
bobzhang force-pushed the hongbo/extend-string-internal-regex_engine branch 3 times, most recently from d53a040 to d716b49 Compare July 23, 2026 02:18
…a extend

Enable `implicit_impl_as_method` (E0079) for the `string/internal/regex_engine` package (in its
moon.pkg) and make its trait-impl promotions explicit via `extend`, in a
dedicated string/internal/regex_engine/extends.mbt shim.

The compiler flags only @debug.Debug for the MatchResult type, deprecated (no promotions).

Deprecated promotions carry `#deprecated(..., skip_current_package=true)` +
`#doc(hidden)`, each message naming the concrete replacement; they stay callable
but are hidden from pkg.generated.mbti.

Part of the per-package series (see #3849 for deque). Scoped to string/internal/regex_engine/.

Verified: `moon check --deny-warn --target all` clean; `moon test -p string/internal/regex_engine --target all` green.

Reviewed and signed off by Codex CLI.

Signed-off-by: Codex CLI <codex@openai.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bobzhang
bobzhang force-pushed the hongbo/extend-string-internal-regex_engine branch from d716b49 to 5ed1fd9 Compare July 23, 2026 03:02
@bobzhang
bobzhang merged commit 82e4c79 into main Jul 23, 2026
15 checks passed
@bobzhang
bobzhang deleted the hongbo/extend-string-internal-regex_engine branch July 23, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants