Narrow AdvancedCollectionView trimming warning so that it only triggers in unsafe usages#724
Open
sylveon wants to merge 10 commits intoCommunityToolkit:mainfrom
Open
Narrow AdvancedCollectionView trimming warning so that it only triggers in unsafe usages#724sylveon wants to merge 10 commits intoCommunityToolkit:mainfrom
sylveon wants to merge 10 commits intoCommunityToolkit:mainfrom
Conversation
Arlodotexe
reviewed
Oct 14, 2025
Member
Arlodotexe
left a comment
There was a problem hiding this comment.
Looks good, but I'd like explicit approval from @Sergio0694 before we merge
Sergio0694
requested changes
Oct 14, 2025
Member
Sergio0694
left a comment
There was a problem hiding this comment.
This is not a good way to fix this. This whole type would need to be reworked to be properly trim-safe. For instance, there's nothing enforcing that the T being used to create a sort descriptor will actually match the source type being used. Additionally annotating a T and then suppressing is not correct, the annotations should rather flow. As a rule of thumb, suppressions are almost always incorrect and should be avoided.
Sergio0694
requested changes
Oct 25, 2025
Member
Sergio0694
left a comment
There was a problem hiding this comment.
Better than before but it's not entirely safe 😅
components/Collections/src/AdvancedCollectionView/SortDescription.cs
Outdated
Show resolved
Hide resolved
3 tasks
Sergio0694
reviewed
Feb 6, 2026
components/Collections/src/AdvancedCollectionView/SortDescription{T}.cs
Outdated
Show resolved
Hide resolved
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes
Fixes #723
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Trimming warning triggers on every usage of AdvancedCollectionView
What is the new behavior?
Trimming warning only triggers when you make use of reflection-based sorting.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information