Browse Source

Do not add parentheses to AnonymousMethodExpression if there are no parameters.

pull/892/merge
Siegfried Pammer 8 years ago
parent
commit
3f886414b0
  1. 2
      ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

2
ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

@ -1033,7 +1033,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1033,7 +1033,7 @@ namespace ICSharpCode.Decompiler.CSharp
AnonymousMethodExpression ame = new AnonymousMethodExpression();
ame.IsAsync = function.IsAsync;
ame.Parameters.AddRange(MakeParameters(method, function));
ame.HasParameterList = true;
ame.HasParameterList = ame.Parameters.Count > 0;
StatementBuilder builder = new StatementBuilder(typeSystem.GetSpecializingTypeSystem(new SimpleTypeResolveContext(method)), this.decompilationContext, method, function, settings, cancellationToken);
var body = builder.ConvertAsBlock(function.Body);
bool isLambda = false;

Loading…
Cancel
Save