diff --git a/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs b/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs index 1e0ce47bf..c37957f5f 100644 --- a/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs +++ b/ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs @@ -369,6 +369,8 @@ namespace ICSharpCode.Decompiler.Ast.Transforms // Now create variables for all fields of the display class (except for those that we already handled as parameters) List> variablesToDeclare = new List>(); foreach (FieldDefinition field in type.Fields) { + if (field.IsStatic) + continue; // skip static fields if (dict.ContainsKey(field)) // skip field if it already was handled as parameter continue; EnsureVariableNameIsAvailable(blockStatement, field.Name); diff --git a/ICSharpCode.Decompiler/DecompilerSettings.cs b/ICSharpCode.Decompiler/DecompilerSettings.cs index 78ccf7e60..f4a20e047 100644 --- a/ICSharpCode.Decompiler/DecompilerSettings.cs +++ b/ICSharpCode.Decompiler/DecompilerSettings.cs @@ -179,7 +179,7 @@ namespace ICSharpCode.Decompiler } } - bool objectCollectionInitializers; + bool objectCollectionInitializers = true; /// /// Gets/Sets whether to use C# 3.0 object/collection initializers