8000 Resolve push_iter conflict by bobzhang · Pull Request #2249 · moonbitlang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Resolve push_iter conflict #2249

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

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

bobzhang
Copy link
Contributor

Summary

  • convert push_iter into a method on Array
  • add a deprecated alias for the old function

Testing

  • moon fmt
  • moon info

https://chatgpt.com/codex/tasks/task_e_6849491b009c8320bbee298e7355d1e4

Copy link
peter-jerry-ye-code-review bot commented Jun 11, 2025
The change improves API consistency by making push_iter a method

Category
Maintainability
Code Snippet
pub fn[T] Array::push_iter(self : Self[T], iter : Iter[T]) -> Unit
Recommendation
The change is good. Consider updating documentation to show method call style in examples
Reasoning
Making push_iter a method is more consistent with other Array operations and follows object-oriented principles. The self parameter is now explicitly typed as Self[T] which is clearer.

Deprecation notice lacks migration instructions

Category
Maintainability
Code Snippet
#deprecated("use method call")
Recommendation
Add more specific migration instructions, e.g. #deprecated("use arr.push_iter(iter) instead of push_iter(arr, iter)")
Reasoning
Clear migration paths help users update their code. The current message 'use method call' might not be clear enough for all users.

Documentation example shows old function call style

Category
Correctness
Code Snippet
/// push_iter(u, [4, 5, 6].iter())
/// assert_eq(u, [1, 2, 3, 4, 5, 6])
Recommendation
Update example to use new method style: u.push_iter([4, 5, 6].iter())
Reasoning
Documentation should reflect the recommended usage pattern, especially since the old style is now deprecated.

@bobzhang bobzhang force-pushed the codex/resolve-merge-conflict-and-format-code branch from 63e9f26 to c6c775e Compare June 11, 2025 09:33
@bobzhang bobzhang enabled auto-merge (rebase) June 11, 2025 09:34
@coveralls
Copy link
Collaborator
coveralls commented Jun 11, 2025

Pull Request Test Coverage Report for Build 7214

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.087%

Totals Coverage Status
Change from base Build 7210: 0.0%
Covered Lines: 8551
Relevant Lines: 9186

💛 - Coveralls

@bobzhang bobzhang merged commit b57f5ae into main Jun 11, 2025
8 of 12 checks passed
@bobzhang bobzhang deleted the codex/resolve-merge-conflict-and-format-code branch June 11, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0