-
Notifications
You must be signed in to change notification settings - Fork 139
make ArrayView::start_offset public #2803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 makes the start_offset
method public for the ArrayView
type, allowing external access to the starting offset of an array view.
- Adds a public
start_offset
method that wraps the existing privatestart
method - Exposes the starting offset functionality to external consumers of the
ArrayView
API
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
array/view.mbt | Adds private start method and public start_offset wrapper method |
array/pkg.generated.mbti | Updates package interface to include the new public method signature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
///| | ||
fn[T] ArrayView::start(self : ArrayView[T]) -> Int = "%arrayview.start" | ||
///| |
There was a problem hiding this comment.
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.
///| | |
/// | |
/// 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.
fn[T] ArrayView::start(self : ArrayView[T]) -> Int = "%arrayview.start" | ||
///| | ||
pub fn[T] ArrayView::start_offset(self : Self[T]) -> Int { |
There was a problem hiding this comment.
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.
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.
Pull Request Test Coverage Report for Build 1449Details
💛 - Coveralls |
No description provided.