Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NativeAOT] Remove unnecessary [DynamicDependency] attributes (#18808)
This is a follow-up to #18666 This PR resolves the following warnings that I've seen in build logs when running MySingleView with NativeAOT: ``` ILLink : warning IL2034: <Module>..cctor(): The 'DynamicDependencyAttribute' could not be analyzed. [/..../xamarin/xamarin-macios/tests/dotnet/MySingleView/MySingleView.csproj] ILLink : warning IL2034: <Module>..cctor(): The 'DynamicDependencyAttribute' could not be analyzed. [/..../xamarin/xamarin-macios/tests/dotnet/MySingleView/MySingleView.csproj] ... ``` The generated module cctor code looks like this: ```c# internal class <Module> { [DynamicDependency("InvokeConformsToProtocol(ObjCRuntime.NativeHandle)", typeof(NSObject))] [DynamicDependency("Foundation.NSObject", null)] [DynamicDependency("ConformsToProtocol(ObjCRuntime.NativeHandle)", typeof(NSObject))] [DynamicDependency("Foundation.NSObject", null)] // ... static <Module>() { // ... } } ``` The `[DynamicDependency("T", null)]` attributes are invalid. We could change them to `[DynamicDependency(DynamicallyAccessedMemberTypes.None, typeof(T))]` but I think that attribute is redundant because the type itself is always already preserved through the attribute that precedes it with a selector of one of its methods/fields.
- Loading branch information
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.