Skip to content

Conversation

@peter-jerry-ye
Copy link
Contributor

Summary

Fixed type compatibility warnings by updating string indexing operations to use UInt16 instead of Int. This addresses the breaking change where string[i] now returns UInt16 instead of Int.

Changes

  • pkg.generated.mbti: Updated type annotation for string indexing return type
  • pretty.mbt: Updated string indexing operation to handle UInt16 return type

Why These Changes Were Made

The MoonBit language introduced a breaking change where string indexing operations (string[i]) now return UInt16 instead of Int. This caused type warnings throughout the codebase. The minimal changes ensure:

  • moon check passes without warnings
  • Type safety is maintained with proper UInt16 handling
  • No unnecessary modifications to packages that don't need fixing

Implementation Details

The fixes involve simple type conversions and annotations to align with the new string indexing behavior. These are minimal, targeted changes that address the core type compatibility issue without affecting the overall functionality of the pretty printer.

…ue.PriorityQueue

Co-authored-by: openhands <openhands@all-hands.dev>
@peter-jerry-ye peter-jerry-ye merged commit c4dd48a into main Dec 12, 2025
9 of 15 checks passed
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.

3 participants