-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Strip the ILLinkTrim.xml file from the System.ComponentModel.TypeConverter assembly #37402
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1dc0187
Strip the ILLinkTrim.xml file from the System.ComponentModel.TypeConv…
layomia 4702782
Address review feedback
layomia 667969e
Merge remote-tracking branch 'upstream/master' into trim_xml_typeconv…
layomia e4a268b
Update DefaultConstructor -> PublicParameterlessConstructor
layomia 6643238
Fix ComObjectType property annotation
layomia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
(nit) - this may be a preference thing, but IMO it feels more natural for this attribute to be applied to the property:
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'm actually not sure linker will be able to handle this - the attribute on a property works for implicit getters/setters, but for those with explicit bodies it might not be reliable (since we need to detect the backing field if there's one to annotate it as well, and that detection is tricky/impossible for random properties).
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.
Note that if it doesn't work linker will not warn - TODO - I created dotnet/linker#1248 to get that fixed.
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 behavior is that if the annotation is placed on the property, the annotation is propagated to the return value of the getter and the parameter of the setter. If this is an auto property, the annotation is also propagated to the backing field. Otherwise, this won't propagate to the backing field, even if it looks "obvious". One will get a warning and needs to annotate the backing field manually.
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.
What about this case where there is no backing field? Does the
TypeDescriptorComObject
type get annotated with[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
if the attribute is applied to the property?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.
This part applies always: "The behavior is that if the annotation is placed on the property, the annotation is propagated to the return value of the getter and the parameter of the setter"
Yes, because it's a value that was returned from a method that has the return parameter annotated (because the annotation was propagated from the property).