Skip to content

Conversation

sylveon
Copy link

@sylveon sylveon commented Aug 28, 2025

Fixes

Fixes #723

PR Type

What kind of change does this PR introduce?

  • Bugfix

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:

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • Tested code with current supported SDKs
  • New component
    • Documentation has been added
    • Sample in sample app has been added
    • Analyzers are passing for documentation and samples
    • Icon has been created (if new sample) following the Thumbnail Style Guide and templates
  • Tests for the changes have been added (if applicable)
  • Header has been added to all new source files
  • Contains NO breaking changes

Other information

@Arlodotexe Arlodotexe added nativeaot The dependency on dotnet NativeAOT components::collections This package contains the AdvancedCollectionView and IncrementalLoadingCollection. labels Oct 14, 2025
Copy link
Member

@Arlodotexe Arlodotexe left a comment

Choose a reason for hiding this comment

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

Looks good, but I'd like explicit approval from @Sergio0694 before we merge

Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components::collections This package contains the AdvancedCollectionView and IncrementalLoadingCollection. nativeaot The dependency on dotnet NativeAOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdvancedCollectionView trimming warning is too broad

3 participants