Browse Source

Fix #1365: Finalize method missing custom attributes.

pull/1405/head
Siegfried Pammer 6 years ago
parent
commit
36baae8ff6
  1. 2
      ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemLoaderTests.cs
  2. 1
      ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemTestCase.cs
  3. 2
      ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs

2
ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemLoaderTests.cs

@ -140,7 +140,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -140,7 +140,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(method.IsVirtual);
Assert.IsFalse(method.IsStatic);
Assert.AreEqual(0, method.Parameters.Count);
Assert.AreEqual(0, method.GetAttributes().Count());
Assert.AreEqual(1, method.GetAttributes().Count());
Assert.IsTrue(method.HasBody);
Assert.IsNull(method.AccessorOwner);
}

1
ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemTestCase.cs

@ -35,6 +35,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -35,6 +35,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
public void Method() { }
public SimplePublicClass() { }
[Double(1)]
~SimplePublicClass() { }
}

2
ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs

@ -1358,6 +1358,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1358,6 +1358,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
DestructorDeclaration ConvertDestructor(IMethod dtor)
{
DestructorDeclaration decl = new DestructorDeclaration();
if (ShowAttributes)
decl.Attributes.AddRange(ConvertAttributes(dtor.GetAttributes()));
if (dtor.DeclaringTypeDefinition != null)
decl.Name = dtor.DeclaringTypeDefinition.Name;
if (AddResolveResultAnnotations) {

Loading…
Cancel
Save