diff --git a/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs b/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs index 6e4867192..7d5584f9f 100644 --- a/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs +++ b/src/Java.Interop/Java.Interop/JniRuntime.JniTypeManager.cs @@ -271,14 +271,18 @@ protected virtual IEnumerable GetSimpleReferences (Type type) static readonly Type[] EmptyTypeArray = Array.Empty (); const string NotUsedInAndroid = "This code path is not used in Android projects."; - // FIXME: https://github.com/xamarin/java.interop/issues/1192 - [UnconditionalSuppressMessage ("AOT", "IL3050", Justification = NotUsedInAndroid)] - static Type MakeArrayType (Type type) => type.MakeArrayType (); + static Type MakeArrayType (Type type) => + // FIXME: https://github.com/xamarin/java.interop/issues/1192 + #pragma warning disable IL3050 + type.MakeArrayType (); + #pragma warning restore IL3050 - // FIXME: https://github.com/xamarin/java.interop/issues/1192 [UnconditionalSuppressMessage ("Trimming", "IL2055", Justification = NotUsedInAndroid)] - [UnconditionalSuppressMessage ("AOT", "IL3050", Justification = NotUsedInAndroid)] - static Type MakeGenericType (Type type, Type arrayType) => type.MakeGenericType (arrayType); + static Type MakeGenericType (Type type, Type arrayType) => + // FIXME: https://github.com/xamarin/java.interop/issues/1192 + #pragma warning disable IL3050 + type.MakeGenericType (arrayType); + #pragma warning restore IL3050 [UnconditionalSuppressMessage ("Trimming", "IL2073", Justification = "Types returned here should be preserved via other means.")] [return: DynamicallyAccessedMembers (MethodsConstructorsInterfaces)] diff --git a/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs b/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs index b26e3b614..d0d13c87c 100644 --- a/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs +++ b/src/Java.Interop/Java.Interop/JniRuntime.JniValueManager.cs @@ -370,15 +370,16 @@ static Type GetPeerType ([DynamicallyAccessedMembers (Constructors)] Type type) static Type? AssemblyGetType (Assembly assembly, string typeName) => assembly.GetType (typeName); - // FIXME: https://github.com/xamarin/java.interop/issues/1192 [UnconditionalSuppressMessage ("Trimming", "IL2055", Justification = makeGenericTypeMessage)] - [UnconditionalSuppressMessage ("AOT", "IL3050", Justification = makeGenericTypeMessage)] [return: DynamicallyAccessedMembers (Constructors)] static Type MakeGenericType ( [DynamicallyAccessedMembers (Constructors)] Type type, Type [] arguments) => + // FIXME: https://github.com/xamarin/java.interop/issues/1192 + #pragma warning disable IL3050 type.MakeGenericType (arguments); + #pragma warning restore IL3050 Type[] arguments = type.GetGenericArguments (); if (arguments.Length == 0) @@ -657,11 +658,12 @@ static JniValueMarshaler GetObjectArrayMarshaler (Type elementType) { const string makeGenericMethodMessage = "This code path is not used in Android projects."; - // FIXME: https://github.com/xamarin/java.interop/issues/1192 [UnconditionalSuppressMessage ("Trimming", "IL2060", Justification = makeGenericMethodMessage)] - [UnconditionalSuppressMessage ("AOT", "IL3050", Justification = makeGenericMethodMessage)] static MethodInfo MakeGenericMethod (MethodInfo method, Type type) => + // FIXME: https://github.com/xamarin/java.interop/issues/1192 + #pragma warning disable IL3050 method.MakeGenericMethod (type); + #pragma warning restore IL3050 Func indirect = GetObjectArrayMarshalerHelper; var reifiedMethodInfo = MakeGenericMethod (