Browse Source

Fix build.

pull/1012/head
Siegfried Pammer 8 years ago
parent
commit
af08020802
  1. 4
      ICSharpCode.Decompiler/CSharp/Transforms/ConvertConstructorCallIntoInitializer.cs

4
ICSharpCode.Decompiler/CSharp/Transforms/ConvertConstructorCallIntoInitializer.cs

@ -156,12 +156,12 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -156,12 +156,12 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
} while (allSame);
}
}
internal void RemoveSingleEmptyConstructor(IEnumerable<AstNode> members, ITypeDefinition contextTypeDefinition)
{
if (contextTypeDefinition == null) return;
var instanceCtors = members.OfType<ConstructorDeclaration>().Where(c => (c.Modifiers & Modifiers.Static) == 0).ToArray();
if (instanceCtors.Length == 1 && members.Skip(1).Any()) {
if (instanceCtors.Length == 1 && (members.Skip(1).Any() || instanceCtors[0].Parent is TypeDeclaration)) {
ConstructorDeclaration emptyCtor = new ConstructorDeclaration();
emptyCtor.Modifiers = contextTypeDefinition.IsAbstract ? Modifiers.Protected : Modifiers.Public;
emptyCtor.Body = new BlockStatement();

Loading…
Cancel
Save