[mono] Fix regression introduced by PR 55726 (#58255)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fri, 27 Aug 2021 19:29:13 +0000 (21:29 +0200)
committerGitHub <noreply@github.com>
Fri, 27 Aug 2021 19:29:13 +0000 (21:29 +0200)
* Fix endless recursion in AssemblyBuilder.GetCustomAttributesData()
  and ModuleBuilder.GetCustomAttributesData()

* Re-enable test cases that now pass on Mono

Co-authored-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
src/libraries/System.Reflection.Emit/tests/AssemblyBuilderTests.cs
src/mono/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.Mono.cs
src/mono/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.Mono.cs

index fb86151..7c6b3c3 100644 (file)
@@ -36,7 +36,6 @@ namespace System.Reflection.Emit.Tests
         }
 
         [Theory]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/2389", TestRuntimes.Mono)]
         [MemberData(nameof(DefineDynamicAssembly_TestData))]
         public void DefineDynamicAssembly_AssemblyName_AssemblyBuilderAccess(AssemblyName name, AssemblyBuilderAccess access)
         {
@@ -57,7 +56,6 @@ namespace System.Reflection.Emit.Tests
         }
 
         [Theory]
-        [ActiveIssue("https://github.com/dotnet/runtime/issues/2389", TestRuntimes.Mono)]
         [MemberData(nameof(DefineDynamicAssembly_CustomAttributes_TestData))]
         public void DefineDynamicAssembly_AssemblyName_AssemblyBuilderAccess_CustomAttributeBuilder(AssemblyName name, AssemblyBuilderAccess access, IEnumerable<CustomAttributeBuilder> attributes)
         {
index 0c1d752..9e9d0d9 100644 (file)
@@ -396,7 +396,7 @@ namespace System.Reflection.Emit
         public override object[] GetCustomAttributes(Type attributeType, bool inherit) =>
             CustomAttribute.GetCustomAttributes(this, attributeType, inherit);
 
-        public override IList<CustomAttributeData> GetCustomAttributesData() => CustomAttributeData.GetCustomAttributes(this);
+        public override IList<CustomAttributeData> GetCustomAttributesData() => CustomAttribute.GetCustomAttributesData(this);
     }
 }
 #endif
index 2c8a240..1e471e8 100644 (file)
@@ -952,7 +952,7 @@ namespace System.Reflection.Emit
 
         public override IList<CustomAttributeData> GetCustomAttributesData()
         {
-            return CustomAttributeData.GetCustomAttributes(this);
+            return CustomAttribute.GetCustomAttributesData(this);
         }
 
         [RequiresUnreferencedCode("Fields might be removed")]