Browse Source

Leave off '.Invoke' when calling delegates.

pull/897/head
Daniel Grunwald 8 years ago
parent
commit
af8993f641
  1. 2
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs
  2. 2
      ICSharpCode.Decompiler/CSharp/CallBuilder.cs

2
ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs

@ -97,7 +97,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -97,7 +97,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public T TestHelp<T>(T t, Func<T, T> f)
{
return f.Invoke(t);
return f(t);
}
public void CheckedInArrayCreationArgument(int a, int b)

2
ICSharpCode.Decompiler/CSharp/CallBuilder.cs

@ -161,6 +161,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -161,6 +161,8 @@ namespace ICSharpCode.Decompiler.CSharp
int allowedParamCount = (method.ReturnType.IsKnownType(KnownTypeCode.Void) ? 1 : 0);
if (method.IsAccessor && (method.AccessorOwner.SymbolKind == SymbolKind.Indexer || expectedParameters.Count == allowedParamCount)) {
return HandleAccessorCall(inst, target, method, arguments.ToList());
} else if (method.Name == "Invoke" && method.DeclaringType.Kind == TypeKind.Delegate) {
return new InvocationExpression(target, arguments.Select(arg => arg.Expression)).WithILInstruction(inst).WithRR(rr);
} else {
bool requireTypeArguments = false;
bool targetCasted = false;

Loading…
Cancel
Save