Skip to content

Fix TableLayoutSettings.StyleConverter trim warnings - #11176

Merged
sbomer merged 2 commits into
dotnet:mainfrom
sbomer:tableLayoutStyle
Apr 9, 2024
Merged

sbomer merged 2 commits into
dotnet:mainfrom
sbomer:tableLayoutStyle

Conversation

@sbomer

@sbomer sbomer commented Apr 8, 2024 •

Copy link
Copy Markdown
Member

[DynamicallyAccessedMembers(PublicConstructors)] on TableLayoutStyle will treat the return value of this.GetType() inside of methods on the type as satisfying PublicConstructors, which is required by the GetConstructor call.

The helper method is needed because trim analysis doesn't treat style.GetType() the same way. See dotnet/runtime#100786.

Microsoft Reviewers: Open in CodeFlow

@sbomer
sbomer requested review from JeremyKuhne and LakshanF April 8, 2024 18:59
@sbomer
sbomer requested a review from a team as a code owner April 8, 2024 18:59
@codecov

codecov Bot commented Apr 8, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.45000%. Comparing base (561af9e) to head (de05517).
Report is 3 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #11176         +/-   ##
===================================================
+ Coverage   73.44838%   73.45000%   +0.00162%     
===================================================
  Files           3098        3098                 
  Lines         632225      632226          +1     
  Branches       46653       46653                 
===================================================
+ Hits          464359      464370         +11     
+ Misses        164468      164462          -6     
+ Partials        3398        3394          -4     
Flag Coverage Δ
Debug 73.45000% <100.00000%> (+0.00162%) ⬆️
integration 18.36859% <0.00000%> (+0.01266%) ⬆️
production 46.91913% <100.00000%> (+0.00372%) ⬆️
test 94.98599% <ø> (ø)
unit 43.88521% <100.00000%> (+0.02597%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

namespace System.Windows.Forms;

[TypeConverter(typeof(TableLayoutSettings.StyleConverter))]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only 2 classes that extend this type and should not cause too much of code bloat with this annotation.

@LakshanF LakshanF left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sbomer
sbomer merged commit ea8b214 into dotnet:main Apr 9, 2024
@dotnet-policy-service dotnet-policy-service Bot added this to the 9.0 Preview4 milestone Apr 9, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants