-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix some unused mutability & make some type private #1049
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
From the provided
These are the most noticeable issues based on the provided diff. Ensure that these changes align with the intended functionality and adhere to the MoonBit language specifications. |
Pull Request Test Coverage Report for Build 3262Details
💛 - Coveralls |
@@ -56,5 +56,5 @@ test "minimum.ref" { | |||
|
|||
// For testing purposes | |||
priv struct T { | |||
mut x : 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.
The mut
is indented to make compiler unable to do unbox optimization on type T
.
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.
While there's no something likes //@warning "-unused-mut"
. I think we need a manual assignment statement to eliminate the warning?
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.
Currently T
will not be unboxed globally even if its only field is immutable. If some value of T
is used locally by accessing field only then that particular value may be unboxed, but that's not the case here, and mutable structs also get unboxed in that case.
This test itself may be controversial but let's discuss and fix that in a separate PR
There are some bug fixes in yesterday's compiler release on the format of default trait |
While improving MoonBit's unused warning, I found several struct field with unused mutability & some types that should be made private on core. This PR fixes these unused things