feat(string/internal/regex_engine): make trait promotions explicit via extend#3885
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_methodwarnings for thestring/internal/regex_enginepackage. - Add
extends.mbtto explicitly (but deprecated) extendMatchResultwith@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.
Collaborator
Coverage Report for CI Build 5452Coverage remained the same at 91.293%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
bobzhang
enabled auto-merge (rebase)
July 23, 2026 01:58
bobzhang
force-pushed
the
hongbo/extend-string-internal-regex_engine
branch
3 times, most recently
from
July 23, 2026 02:18
d53a040 to
d716b49
Compare
…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
force-pushed
the
hongbo/extend-string-internal-regex_engine
branch
from
July 23, 2026 03:02
d716b49 to
5ed1fd9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of the per-package series migrating
moonbitlang/coreoff implicit trait-method promotion (see #3849 fordeque). Coversstring/internal/regex_engineonly.The compiler flags only @debug.Debug for the MatchResult type, deprecated (no promotions).
Deprecations carry
#doc(hidden), sopkg.generated.mbtigains only the promoted methods. Scoped tostring/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>