Skip to content

Commit

Permalink
Fix "Missing variable name in created C# code". Closes #81.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Mar 14, 2011
1 parent 80fa674 commit 2601a49
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 211 deletions.
5 changes: 3 additions & 2 deletions ICSharpCode.Decompiler/Ast/AstBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ MethodDeclaration CreateMethod(MethodDefinition methodDef)
astMethod.Modifiers = ConvertModifiers(methodDef);
else
astMethod.PrivateImplementationType = ConvertType(methodDef.Overrides.First().DeclaringType);
astMethod.Body = AstMethodBodyBuilder.CreateMethodBody(methodDef, context);
astMethod.Body = AstMethodBodyBuilder.CreateMethodBody(methodDef, context, astMethod.Parameters);
}
ConvertAttributes(astMethod, methodDef);
if (methodDef.HasCustomAttributes && astMethod.Parameters.Count > 0) {
Expand Down Expand Up @@ -661,7 +661,7 @@ ConstructorDeclaration CreateConstructor(MethodDefinition methodDef)
}
astMethod.Name = CleanName(methodDef.DeclaringType.Name);
astMethod.Parameters.AddRange(MakeParameters(methodDef.Parameters));
astMethod.Body = AstMethodBodyBuilder.CreateMethodBody(methodDef, context);
astMethod.Body = AstMethodBodyBuilder.CreateMethodBody(methodDef, context, astMethod.Parameters);
ConvertAttributes(astMethod, methodDef);
return astMethod;
}
Expand Down Expand Up @@ -793,6 +793,7 @@ public static IEnumerable<ParameterDeclaration> MakeParameters(IEnumerable<Param
{
foreach(ParameterDefinition paramDef in paramCol) {
ParameterDeclaration astParam = new ParameterDeclaration();
astParam.AddAnnotation(paramDef);
astParam.Type = ConvertType(paramDef.ParameterType, paramDef);
astParam.Name = paramDef.Name;

Expand Down
Loading

0 comments on commit 2601a49

Please sign in to comment.