-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Keep metadata for rooted members in ILLink #102850
Conversation
preserve="fields" only keeps backing fields if a property is already marked. This looks like it depends on the marking order which is unfortunate, but let's keep the existing behavior for now.
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.
Thank you!
if (propertyDefinition != null && !Annotations.IsMarked (propertyDefinition)) | ||
continue; |
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.
Do we ever need to mark a backing field as visible to reflection since it's reflection over compiler generated code? Could we remove the IsMarked check?
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.
I like the idea - filed #102856 to track it.
Should we also mark members marked by the DebuggerDisplayAttribute as visible to reflection? Not necessarily in this PR. |
ILLink wasn't keeping metadata (specifically parameter names) for rooted members, whether rooted as: - part of a root assembly - by a root descriptor XML. - by DebuggerDisplayAttribute/DebuggerTypeProxyAttribute This ensures all of those mark members visible to reflection so that method parameter names are kept.
ILLink wasn't keeping metadata (specifically parameter names) for rooted members, whether rooted as part of a root assembly, or by a descriptor XML.
Fixes #81979