Browse Source

Fix #1741: Use __ld(virt)ftn(...) pattern for accessor method group references.

pull/1754/head
Siegfried Pammer 6 years ago
parent
commit
645341b860
  1. 4
      ICSharpCode.Decompiler/CSharp/CallBuilder.cs

4
ICSharpCode.Decompiler/CSharp/CallBuilder.cs

@ -1246,6 +1246,10 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1246,6 +1246,10 @@ namespace ICSharpCode.Decompiler.CSharp
private bool CanUseDelegateConstruction(IMethod targetMethod, ILInstruction thisArg, IMethod invokeMethod)
{
// Accessors cannot be directly referenced as method group in C#
// see https://github.com/icsharpcode/ILSpy/issues/1741#issuecomment-540179101
if (targetMethod.IsAccessor)
return false;
if (targetMethod.IsStatic) {
// If the invoke method is known, we can compare the parameter counts to figure out whether the
// delegate is static or binds the first argument

Loading…
Cancel
Save