Browse Source

Fixed issue in lambda decompilation when a closure class contains static fields (cached delegates).

pull/144/head
Daniel Grunwald 14 years ago
parent
commit
0764fd7ca7
  1. 2
      ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs
  2. 2
      ICSharpCode.Decompiler/DecompilerSettings.cs

2
ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs

@ -369,6 +369,8 @@ namespace ICSharpCode.Decompiler.Ast.Transforms @@ -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<Tuple<AstType, string>> variablesToDeclare = new List<Tuple<AstType, string>>();
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);

2
ICSharpCode.Decompiler/DecompilerSettings.cs

@ -179,7 +179,7 @@ namespace ICSharpCode.Decompiler @@ -179,7 +179,7 @@ namespace ICSharpCode.Decompiler
}
}
bool objectCollectionInitializers;
bool objectCollectionInitializers = true;
/// <summary>
/// Gets/Sets whether to use C# 3.0 object/collection initializers

Loading…
Cancel
Save