diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs index 18d033b5c4394..3198e9fd45802 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/CustomAttributeTypedArgument.cs @@ -66,7 +66,7 @@ internal string ToString(bool typed) result.Append('['); int count = array.Count; result.Append(count.ToString()); - result.Append(']'); + result.Append("] { "); for (int i = 0; i < count; i++) { diff --git a/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs b/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs index d016e53c75e29..4460797182c87 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs @@ -52,6 +52,14 @@ public static void Test_CustomAttributeTypedArgument_Constructor() 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() { } }