Skip to content

refactor(builtin): FixedArray/ReadOnlyArray::starts_with/ends_with take ArrayView#3471

Open
bobzhang wants to merge 1 commit intomainfrom
hongbo/fixedarray-readonly-starts-ends-view
Open

refactor(builtin): FixedArray/ReadOnlyArray::starts_with/ends_with take ArrayView#3471
bobzhang wants to merge 1 commit intomainfrom
hongbo/fixedarray-readonly-starts-ends-view

Conversation

@bobzhang
Copy link
Copy Markdown
Contributor

@bobzhang bobzhang commented Apr 26, 2026

Summary

Mirrors the recently-merged Array::starts_with/ends_with migration (#3470). Both FixedArray and ReadOnlyArray slice to ArrayView[T], so making the prefix/suffix parameter an ArrayView[T] keeps the API symmetric with Array, String, and Bytes.

Existing callers that pass an array literal (arr.starts_with([1, 2])) continue to work — the literal is inferred as an ArrayView.

Test plan

  • moon fmt, moon info
  • moon test -p moonbitlang/core/builtin — 2812/2812 pass

Open in Devin Review

…ke ArrayView

Mirrors the recently-merged Array migration. Both FixedArray and
ReadOnlyArray slice to ArrayView[T], so the prefix/suffix parameter
becomes ArrayView[T] for symmetry with Array, String, and Bytes.

Existing callers passing array literals are unaffected — the literal
is inferred as an ArrayView.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 3947

Coverage decreased (-0.001%) to 94.887%

Details

  • Coverage decreased (-0.001%) from the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15568
Covered Lines: 14772
Line Coverage: 94.89%
Coverage Strength: 220411.95 hits per line

💛 - Coveralls

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.

2 participants