-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Trying to support changing member accessibility #108350
Conversation
@lambdageek if this is what you were suggesting I will create a test case on wasm debugger tests after your review. |
@lambdageek it also works if I don't call |
} | ||
} else { |
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.
@lambdageek It also works if I completely remove this else.
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.
@thaystg in your test was the field previously used? if field->type != NULL
then mono_field_resolve_type
should overwrite it and include the new visibility attributes.
Something like the f2
function in this example #108097 (comment) - should see the new visibility. So if you're changing public
->private
then f1
that already ran before the update will keep working, but f2
created after the update should throw a MemberAccessException
if (!is_addition && token_table == MONO_TABLE_FIELD) { | ||
add_member_typedef = log_token; |
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.
Let's not do it like this. the add_member_XXX
variables are there because the ADD functions all come paired with another row with a DEFAULT function - it's kind of a hack to make sure we process them together. we don't need it for rows that are self-contained.
Just move the assert in the MONO_TABLE_FIELD
case into the is_addition
branch:
if (is_addition) {
g_assert (add_member_typedef);
// the rest is all the same
} else {
// just use log_token instead of add_member_typedef
}
@thaystg FYI, from Tomas:
We also need to support changing visibility for methods/properties/events/nested types |
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
Fixes #108097