Skip to content

[TrimmableTypeMap] Remove all [UnconditionalSuppressMessage] and fix related [DynamicallyAccessedMembers] #11012

Description

@simonrozsival

Part of #10788

There are several locations in code where we use [UnconditionalSuppressMessage(...)] together with [return: DynamicallyAccessedMembers(...)]. The use of these attributes does not inform the trimmer where it should preserve methods and metadata, but it tries to simply avoid IL2*** and IL3*** warnings. These annotations should be removed: We don't need them for the trimmable type map and they are not needed for the Mono typemap anyway. To suppress warnings, we should use [RequiresUnreferencedCode] and [RequiresDynamicCode] instead.

Additionaly, it appears some types have unnecessary [DynamicallyAccessedMembers] attributes, for example I do not think we need to use them with JavaDictionary<K, V>. This requires further investigation.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions