Skip to content

Commit 485ca1d

Browse files
Fix #3353: Normal method is decompiled as lambda expression.
1 parent 453fc06 commit 485ca1d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ internal class Dummy
4040
[CompilerGenerated]
4141
internal class Helper
4242
{
43+
[CompilerGenerated]
4344
internal bool HelpMe(Dummy dum)
4445
{
4546
return true;

ICSharpCode.Decompiler/IL/Transforms/DelegateConstruction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static bool IsAnonymousMethod(ITypeDefinition decompiledTypeDefinition, IMethod
115115
return false;
116116
if (!(method.HasGeneratedName()
117117
|| method.Name.Contains("$")
118-
|| method.IsCompilerGeneratedOrIsInCompilerGeneratedClass()
118+
|| method.IsCompilerGenerated()
119119
|| TransformDisplayClassUsage.IsPotentialClosure(
120120
decompiledTypeDefinition, method.DeclaringTypeDefinition)
121121
|| ContainsAnonymousType(method)))

0 commit comments

Comments
 (0)