From 1e560ac1ba3b49e0c15864ef52c714135de55bd9 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 22 Aug 2017 11:36:28 +0200 Subject: [PATCH] Extend ConvertConstructorCallIntoInitializer to support C# 6 property initializers --- .../ConvertConstructorCallIntoInitializer.cs | 35 ++-- .../Tests/ICSharpCode.Decompiler.Tests.csproj | 1 + .../Tests/PrettyTestRunner.cs | 12 ++ .../Tests/TestCases/Pretty/AutoProperties.cs | 24 +++ .../Pretty/AutoProperties.opt.roslyn.il | 167 +++++++++++++++++ .../TestCases/Pretty/AutoProperties.roslyn.il | 172 ++++++++++++++++++ 6 files changed, 398 insertions(+), 13 deletions(-) create mode 100644 ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.cs create mode 100644 ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il create mode 100644 ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.roslyn.il diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/ConvertConstructorCallIntoInitializer.cs b/ICSharpCode.Decompiler/CSharp/Transforms/ConvertConstructorCallIntoInitializer.cs index e74f945a0..65678c18b 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/ConvertConstructorCallIntoInitializer.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/ConvertConstructorCallIntoInitializer.cs @@ -118,22 +118,22 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms if (ctorMethodDef != null && ctorMethodDef.DeclaringType.IsReferenceType == false) return; - // Recognize field initializers: - // Translate first statement in all ctors (if all ctors have the same statement) into a field initializer. + // Recognize field or property initializers: + // Translate first statement in all ctors (if all ctors have the same statement) into an initializer. bool allSame; do { Match m = fieldInitializerPattern.Match(instanceCtorsNotChainingWithThis[0].Body.FirstOrDefault()); if (!m.Success) break; - IField field = (m.Get("fieldAccess").Single().GetSymbol() as IField)?.MemberDefinition as IField; - if (field == null) + IMember fieldOrProperty = (m.Get("fieldAccess").Single().GetSymbol() as IMember)?.MemberDefinition; + if (!(fieldOrProperty is IField) && !(fieldOrProperty is IProperty)) break; - AstNode fieldOrEventDecl = members.FirstOrDefault(f => f.GetSymbol() == field); - if (fieldOrEventDecl == null) + AstNode fieldOrPropertyOrEventDecl = members.FirstOrDefault(f => f.GetSymbol() == fieldOrProperty); + if (fieldOrPropertyOrEventDecl == null) break; Expression initializer = m.Get("initializer").Single(); - // 'this'/'base' cannot be used in field initializers + // 'this'/'base' cannot be used in initializers if (initializer.DescendantsAndSelf.Any(n => n is ThisReferenceExpression || n is BaseReferenceExpression)) break; @@ -145,7 +145,11 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms if (allSame) { foreach (var ctor in instanceCtorsNotChainingWithThis) ctor.Body.First().Remove(); - fieldOrEventDecl.GetChildrenByRole(Roles.Variable).Single().Initializer = initializer.Detach(); + if (fieldOrPropertyOrEventDecl is PropertyDeclaration pd) { + pd.Initializer = initializer.Detach(); + } else { + fieldOrPropertyOrEventDecl.GetChildrenByRole(Roles.Variable).Single().Initializer = initializer.Detach(); + } } } while (allSame); } @@ -178,13 +182,18 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms AssignmentExpression assignment = es.Expression as AssignmentExpression; if (assignment == null || assignment.Operator != AssignmentOperatorType.Assign) break; - IField field = (assignment.Left.GetSymbol() as IField)?.MemberDefinition as IField; - if (field == null || !field.IsStatic) + IMember fieldOrProperty = (assignment.Left.GetSymbol() as IMember)?.MemberDefinition; + if (!(fieldOrProperty is IField || fieldOrProperty is IProperty) || !fieldOrProperty.IsStatic) break; - FieldDeclaration fieldDecl = members.OfType().FirstOrDefault(f => f.GetSymbol() == field); - if (fieldDecl == null) + AstNode fieldOrPropertyDecl = members.FirstOrDefault(f => f.GetSymbol() == fieldOrProperty); + if (fieldOrPropertyDecl == null) + break; + if (fieldOrPropertyDecl is FieldDeclaration fd) + fd.Variables.Single().Initializer = assignment.Right.Detach(); + else if (fieldOrPropertyDecl is PropertyDeclaration pd) + pd.Initializer = assignment.Right.Detach(); + else break; - fieldDecl.Variables.Single().Initializer = assignment.Right.Detach(); es.Remove(); } if (staticCtor.Body.Statements.Count == 0) diff --git a/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj index 8b02d2627..b37634066 100644 --- a/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler/Tests/ICSharpCode.Decompiler.Tests.csproj @@ -146,6 +146,7 @@ + diff --git a/ICSharpCode.Decompiler/Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler/Tests/PrettyTestRunner.cs index 710393d3b..4f0b868f1 100644 --- a/ICSharpCode.Decompiler/Tests/PrettyTestRunner.cs +++ b/ICSharpCode.Decompiler/Tests/PrettyTestRunner.cs @@ -52,6 +52,12 @@ namespace ICSharpCode.Decompiler.Tests CompilerOptions.Optimize }; + static readonly CompilerOptions[] roslynOnlyOptions = + { + CompilerOptions.UseRoslyn, + CompilerOptions.Optimize | CompilerOptions.UseRoslyn + }; + static readonly CompilerOptions[] defaultOptions = { CompilerOptions.None, @@ -109,6 +115,12 @@ namespace ICSharpCode.Decompiler.Tests Run(cscOptions: cscOptions); } + [Test] + public void AutoProperties([ValueSource("roslynOnlyOptions")] CompilerOptions cscOptions) + { + Run(cscOptions: cscOptions); + } + void Run([CallerMemberName] string testName = null, AssemblerOptions asmOptions = AssemblerOptions.None, CompilerOptions cscOptions = CompilerOptions.None) { var ilFile = Path.Combine(TestCasePath, testName); diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.cs b/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.cs new file mode 100644 index 000000000..9c069c520 --- /dev/null +++ b/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.cs @@ -0,0 +1,24 @@ +namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty +{ + // TODO : maybe use single-line formatting in this case? + internal class AutoProperties + { + public int A { + get; + } = 1; + + public int B { + get; + set; + } = 2; + + public static int C { + get; + } = 3; + + public static int D { + get; + set; + } = 4; + } +} diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il b/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il new file mode 100644 index 000000000..3f84ea0df --- /dev/null +++ b/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il @@ -0,0 +1,167 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly AutoProperties +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 02 00 00 00 00 00 ) + + .permissionset reqmin + = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module AutoProperties.dll +// MVID: {7040A0B7-F734-4352-9C50-FCEB679C1390} +.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) +.imagebase 0x10000000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x012D0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties + extends [mscorlib]System.Object +{ + .field private initonly int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private static initonly int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private static int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .method public hidebysig specialname instance int32 + get_A() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ret + } // end of method AutoProperties::get_A + + .method public hidebysig specialname instance int32 + get_B() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ret + } // end of method AutoProperties::get_B + + .method public hidebysig specialname instance void + set_B(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 8 (0x8) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0007: ret + } // end of method AutoProperties::set_B + + .method public hidebysig specialname static + int32 get_C() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 6 (0x6) + .maxstack 8 + IL_0000: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0005: ret + } // end of method AutoProperties::get_C + + .method public hidebysig specialname static + int32 get_D() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 6 (0x6) + .maxstack 8 + IL_0000: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0005: ret + } // end of method AutoProperties::get_D + + .method public hidebysig specialname static + void set_D(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ret + } // end of method AutoProperties::set_D + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0007: ldarg.0 + IL_0008: ldc.i4.2 + IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_000e: ldarg.0 + IL_000f: call instance void [mscorlib]System.Object::.ctor() + IL_0014: ret + } // end of method AutoProperties::.ctor + + .method private hidebysig specialname rtspecialname static + void .cctor() cil managed + { + // Code size 13 (0xd) + .maxstack 8 + IL_0000: ldc.i4.3 + IL_0001: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ldc.i4.4 + IL_0007: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_000c: ret + } // end of method AutoProperties::.cctor + + .property instance int32 A() + { + .get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_A() + } // end of property AutoProperties::A + .property instance int32 B() + { + .get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_B() + .set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::set_B(int32) + } // end of property AutoProperties::B + .property int32 C() + { + .get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_C() + } // end of property AutoProperties::C + .property int32 D() + { + .get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_D() + .set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::set_D(int32) + } // end of property AutoProperties::D +} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** diff --git a/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.roslyn.il b/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.roslyn.il new file mode 100644 index 000000000..52c3dcfd7 --- /dev/null +++ b/ICSharpCode.Decompiler/Tests/TestCases/Pretty/AutoProperties.roslyn.il @@ -0,0 +1,172 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly AutoProperties +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 ) + + .permissionset reqmin + = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module AutoProperties.dll +// MVID: {ADC6D805-EAAF-4796-9B6A-0E2CC2F4FFF7} +.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) +.imagebase 0x10000000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x03100000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties + extends [mscorlib]System.Object +{ + .field private initonly int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private static initonly int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private static int32 'k__BackingField' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname instance int32 + get_A() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ret + } // end of method AutoProperties::get_A + + .method public hidebysig specialname instance int32 + get_B() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ret + } // end of method AutoProperties::get_B + + .method public hidebysig specialname instance void + set_B(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 8 (0x8) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0007: ret + } // end of method AutoProperties::set_B + + .method public hidebysig specialname static + int32 get_C() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 6 (0x6) + .maxstack 8 + IL_0000: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0005: ret + } // end of method AutoProperties::get_C + + .method public hidebysig specialname static + int32 get_D() cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 6 (0x6) + .maxstack 8 + IL_0000: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0005: ret + } // end of method AutoProperties::get_D + + .method public hidebysig specialname static + void set_D(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ret + } // end of method AutoProperties::set_D + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0007: ldarg.0 + IL_0008: ldc.i4.2 + IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_000e: ldarg.0 + IL_000f: call instance void [mscorlib]System.Object::.ctor() + IL_0014: nop + IL_0015: ret + } // end of method AutoProperties::.ctor + + .method private hidebysig specialname rtspecialname static + void .cctor() cil managed + { + // Code size 13 (0xd) + .maxstack 8 + IL_0000: ldc.i4.3 + IL_0001: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_0006: ldc.i4.4 + IL_0007: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField' + IL_000c: ret + } // end of method AutoProperties::.cctor + + .property instance int32 A() + { + .get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_A() + } // end of property AutoProperties::A + .property instance int32 B() + { + .get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_B() + .set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::set_B(int32) + } // end of property AutoProperties::B + .property int32 C() + { + .get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_C() + } // end of property AutoProperties::C + .property int32 D() + { + .get int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_D() + .set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::set_D(int32) + } // end of property AutoProperties::D +} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE ***********************