Fixed trim warnings in DDB High Level #3749
Merged
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.
Issue
#3362 (comment)
Description
Awhile back we took in PR #346 that added support for polymorphic types. This created new collections maintained by the DDB high level library for the derived types and these new collection caused trim warnings only when doing an actual aot build. The new collections of types didn't have the required annotations and the fact the fact that calling code was directly interacting with these collections made it hard to annotate.
I refactored the internals to keep access to the collections and only accessible through
TryGet
methods that had the required annotations. Given all types representing user data have the annotations to say keep all metadata the suppressions added in the PR should be safe. All of the derived types will be registered with the with the HLL using theAddDerivedType
method which has the annotations that says don't trim anything from the type.Testing
Dry Run: DRY_RUN-aea16048-9849-4917-81f5-d18dbb9a1e4e (Successful)
Build and ran Native AOT application exercising code paths and confirmed no trim warnings