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

moonbitlang / core / 5111

08 Jul 2026 08:09AM UTC coverage: 91.427% (-0.003%) from 91.43%
5111

push

github

bobzhang
Remove negative index support from view/slice operators

The `_[_:_]` slice operator and its sibling `get_view`/`mut_view` APIs
previously normalized negative indices as offsets from the end
(`if x < 0 { len + x }`). This removes that normalization across
String, StringView, Bytes, BytesView, Array, ArrayView, FixedArray and
MutArrayView so a negative index now falls through to the existing
bounds guard and is rejected (panic, or None for `get_view`), matching
the pre-existing behavior of `UninitializedArray::sub`.

Tests asserting negative-index view results are removed or converted to
equivalent positive indices; "panic negative index" tests are retained
and now verify that negatives are rejected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

15548 of 17006 relevant lines covered (91.43%)

193334.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.21
/builtin/mutarrayview.mbt


Source Not Available

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