diff --git a/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs b/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs index 01f8a8abb..b0931cc1a 100644 --- a/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs +++ b/ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs @@ -1174,7 +1174,7 @@ namespace ICSharpCode.Decompiler.CSharp entityDecl.AddAnnotation(function); if (function.IsIterator) { - if (!body.Descendants.Any(d => d is YieldReturnStatement || d is YieldBreakStatement)) { + if (localSettings.DecompileMemberBodies && !body.Descendants.Any(d => d is YieldReturnStatement || d is YieldBreakStatement)) { body.Add(new YieldBreakStatement()); } RemoveAttribute(entityDecl, KnownAttribute.IteratorStateMachine);