Fix: add missed open curly (#61320)
authorAnnchous <57408376+annchous@users.noreply.github.com>
Mon, 8 Nov 2021 23:05:08 +0000 (02:05 +0300)
committerGitHub <noreply@github.com>
Mon, 8 Nov 2021 23:05:08 +0000 (15:05 -0800)
src/libraries/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs
src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs

index 18d033b..3198e9f 100644 (file)
@@ -66,7 +66,7 @@ namespace System.Reflection
                 result.Append('[');
                 int count = array.Count;
                 result.Append(count.ToString());
-                result.Append(']');
+                result.Append("] { ");
 
                 for (int i = 0; i < count; i++)
                 {
index d016e53..4460797 100644 (file)
@@ -52,6 +52,14 @@ namespace System.Reflection.Tests
             Assert.True(false, "Expected to find MyAttr Attribute");
         }
 
+        [Fact]
+        public static void Test_CustomAttributeTypedArgument_ToString()
+        {
+            var argument = new CustomAttributeTypedArgument(new [] { new CustomAttributeTypedArgument(0) });
+
+            Assert.Equal("new CustomAttributeTypedArgument[1] { 0 }", argument.ToString());
+        }
+
         [MyAttr(MyKinds.First, Desc = "This is a description on a method")]
         private static void MyMethod() { }
     }