Skip to content
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

Remove RequiresUnreferencedCode from DefaultValueAttribute #97842

Closed
Tracked by #4649
LakshanF opened this issue Feb 2, 2024 · 6 comments
Closed
Tracked by #4649

Remove RequiresUnreferencedCode from DefaultValueAttribute #97842

LakshanF opened this issue Feb 2, 2024 · 6 comments
Labels
area-System.ComponentModel linkable-framework Issues associated with delivering a linker friendly framework
Milestone

Comments

@LakshanF
Copy link
Contributor

LakshanF commented Feb 2, 2024

This constructor of DefaultValue has RUC on it. This is likely due to a concern round converters with generic types (Nullable) which has been since fixed in the trimmer.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 2, 2024
@ghost
Copy link

ghost commented Feb 2, 2024

Tagging subscribers to this area: @dotnet/area-system-componentmodel
See info in area-owners.md if you want to be subscribed.

Issue Details

This constructor of DefaultValue has RUC on it. This is likely due to a concern round converters with generic types (Nullable) which has been since fixed in the trimmer.

Author: LakshanF
Assignees: -
Labels:

area-System.ComponentModel

Milestone: -

@steveharter
Copy link
Member

@LakshanF I assume you are proposing removing the RUC. Can you create a PR to do that? Thanks

@steveharter steveharter added this to the 9.0.0 milestone Feb 7, 2024
@steveharter steveharter removed the untriaged New issue has not been triaged by the area owner label Feb 7, 2024
@buyaa-n buyaa-n added the linkable-framework Issues associated with delivering a linker friendly framework label Feb 7, 2024
@ghost
Copy link

ghost commented Feb 7, 2024

Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar
See info in area-owners.md if you want to be subscribed.

Issue Details

This constructor of DefaultValue has RUC on it. This is likely due to a concern round converters with generic types (Nullable) which has been since fixed in the trimmer.

Author: LakshanF
Assignees: -
Labels:

area-System.ComponentModel, linkable-framework

Milestone: 9.0.0

@vitek-karas
Copy link
Member

The Nullable problem is actually only one of the reasons for RUC. Once you fix that, you'll notice that there's a secondary problem where the NullableConverter is calling TypeDescriptor.GetConverter for the underlying type:

UnderlyingTypeConverter = TypeDescriptor.GetConverter(UnderlyingType);

That method has RUC, and so we need to propagate it. I think this would only be fixable once we remove RUC on GetConverter.

@buyaa-n
Copy link
Contributor

buyaa-n commented Jul 26, 2024

@LakshanF isn't it resolved? I don't see the RUC attribute now

@LakshanF
Copy link
Contributor Author

LakshanF commented Jul 29, 2024

Yes, #100821 removed the RUC from the constructor. But there is a RUC on its local function, and if the constructor is called, will result in a trimmer warning. The feature switch, _DefaultValueAttributeSupport, can be used to turn off the warning by setting the property to false (the default value of the property will be set to true)

@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.ComponentModel linkable-framework Issues associated with delivering a linker friendly framework
Projects
None yet
Development

No branches or pull requests

4 participants