Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions array/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ fn[T, U] ArrayView::map(Self[T], (T) -> U raise?) -> Array[U] raise?
fn[T, U] ArrayView::mapi(Self[T], (Int, T) -> U raise?) -> Array[U] raise?
fn[A, B] ArrayView::rev_fold(Self[A], init~ : B, (B, A) -> B raise?) -> B raise?
fn[A, B] ArrayView::rev_foldi(Self[A], init~ : B, (Int, B, A) -> B raise?) -> B raise?
fn[T] ArrayView::start_offset(Self[T]) -> Int
fn[T] ArrayView::to_array(Self[T]) -> Array[T]
fn ArrayView::unsafe_extract_bit(Self[Byte], Int, Int) -> UInt
fn ArrayView::unsafe_extract_byte(Self[Byte], Int, Int) -> UInt
Expand Down
8 changes: 8 additions & 0 deletions array/view.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -457,3 +457,11 @@ pub impl[A : @quickcheck.Arbitrary] @quickcheck.Arbitrary for ArrayView[A] with
) {
Array::arbitrary(size, rs)[:]
}

///|
fn[T] ArrayView::start(self : ArrayView[T]) -> Int = "%arrayview.start"

///|
Copy link
Preview

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

The documentation comments are empty (only contain ///|). These methods should have proper documentation describing their purpose, parameters, and return values.

Suggested change
///|
///
/// Returns the starting offset of the array view.
///
/// # Parameters
/// * `self`: The array view whose starting offset is to be returned.
///
/// # Returns
/// An integer representing the starting offset of the array view.
///
/// # Example
/// ```moonbit
/// let arr = [10, 20, 30, 40, 50]
/// let view = arr[2:4]
/// inspect(view.start_offset(), content="2")
/// ```

Copilot uses AI. Check for mistakes.

pub fn[T] ArrayView::start_offset(self : Self[T]) -> Int {
Copy link
Preview

Copilot AI Oct 2, 2025

Choose a reason for hiding this comment

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

Inconsistent type parameter usage. The start method uses ArrayView[T] while start_offset uses Self[T]. For consistency, both should use the same pattern.

Suggested change
pub fn[T] ArrayView::start_offset(self : Self[T]) -> Int {
pub fn[T] ArrayView::start_offset(self : ArrayView[T]) -> Int {

Copilot uses AI. Check for mistakes.

self.start()
}