diff --git a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs index fe52dba89..dde61d8b2 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/VBAnonymousTypes.cs @@ -3,22 +3,30 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; +#if LEGACY_VBC +using System.Text; +#endif using Microsoft.VisualBasic.CompilerServices; // A VB anonymous type. Its properties are settable and only those declared 'Key' // take part in Equals and GetHashCode, so it cannot be written as a C# anonymous // type and is declared here instead. +#if LEGACY_VBC && OPT +[DebuggerDisplay("Value={Value}, Name={Name}")] +[CompilerGenerated] +#else [CompilerGenerated] [DebuggerDisplay("Value={Value}, Name={Name}")] +#endif internal sealed class VB_AnonymousType_0 { -#if !OPT +#if !OPT && !LEGACY_VBC [DebuggerBrowsable(DebuggerBrowsableState.Never)] #endif private T0 _Value; -#if !OPT +#if !OPT && !LEGACY_VBC [DebuggerBrowsable(DebuggerBrowsableState.Never)] #endif private T1 _Name; @@ -41,7 +49,7 @@ internal sealed class VB_AnonymousType_0 } } -#if !OPT +#if !OPT && !LEGACY_VBC [DebuggerHidden] #endif public VB_AnonymousType_0(T0 Value, T1 Name) @@ -50,12 +58,21 @@ internal sealed class VB_AnonymousType_0 _Name = Name; } -#if !OPT +#if !OPT && !LEGACY_VBC [DebuggerHidden] #endif public override string ToString() { +#if LEGACY_VBC + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("{ "); + stringBuilder.AppendFormat("{0} = {1}, ", "Value", _Value); + stringBuilder.AppendFormat("{0} = {1} ", "Name", _Name); + stringBuilder.Append("}"); + return stringBuilder.ToString(); +#else return string.Format(null, "{{ Value = {0}, Name = {1} }}", new object[2] { _Value, _Name }); +#endif } } [StandardModule]