Browse Source

Fix #3353: Normal method is decompiled as lambda expression.

pull/3455/head
Siegfried Pammer 3 months ago
parent
commit
485ca1d69a
  1. 1
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
  2. 2
      ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

1
ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs

@ -40,6 +40,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.DelegateConstruction @@ -40,6 +40,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.DelegateConstruction
[CompilerGenerated]
internal class Helper
{
[CompilerGenerated]
internal bool HelpMe(Dummy dum)
{
return true;

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

@ -115,7 +115,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -115,7 +115,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
if (!(method.HasGeneratedName()
|| method.Name.Contains("$")
|| method.IsCompilerGeneratedOrIsInCompilerGeneratedClass()
|| method.IsCompilerGenerated()
|| TransformDisplayClassUsage.IsPotentialClosure(
decompiledTypeDefinition, method.DeclaringTypeDefinition)
|| ContainsAnonymousType(method)))

Loading…
Cancel
Save