Skip to content

Conversation

@peter-jerry-ye
Copy link

Summary

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

Changes

  • Updated string indexing operations in multiple files to use proper type conversion
  • Modified generated interface files (.mbti) to reflect the correct return types
  • Applied minimal changes to eliminate warnings while maintaining functionality

Implementation Details

The main change involves converting string indexing results from UInt16 to Int where needed, or updating variable types to match the new UInt16 return type. This ensures compatibility with the updated string indexing behavior while keeping the codebase functional.

Goal

These changes aim to eliminate all warnings with minimal modifications, ensuring moon check works properly and ideally moon test as well. The package functionality is preserved while addressing the type system changes.

Co-authored-by: openhands <openhands@all-hands.dev>
The guard statement was missing the else clause, which is required
in MoonBit. Added panic() as the error handler to match the behavior
of op_set which also panics on invalid index.

Co-authored-by: openhands <openhands@all-hands.dev>
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.

2 participants