Browse Source
Fix removal of attributes injected by the legacy VB compiler
pull/2874/head
ElektroKill
3 years ago
No known key found for this signature in database
GPG Key ID: 7E3C5C084E40E3EC
2 changed files with
4 additions and
6 deletions
-
ICSharpCode.Decompiler.Tests/TestCases/VBPretty/YieldReturn.cs
-
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs
|
|
@ -1,8 +1,5 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
#if LEGACY_VBC
|
|
|
|
using System.Diagnostics; |
|
|
|
#endif
|
|
|
|
|
|
|
|
using Microsoft.VisualBasic.CompilerServices; |
|
|
|
|
|
|
@ -23,9 +20,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.VBPretty |
|
|
|
{ |
|
|
|
private int fieldOnThis; |
|
|
|
|
|
|
|
#if LEGACY_VBC
|
|
|
|
[DebuggerStepThrough] |
|
|
|
#endif
|
|
|
|
public static IEnumerable<char> YieldChars { |
|
|
|
get { |
|
|
|
yield return 'a'; |
|
|
|
|
|
@ -1807,6 +1807,10 @@ namespace ICSharpCode.Decompiler.CSharp |
|
|
|
if (function.StateMachineCompiledWithLegacyVisualBasic) |
|
|
|
{ |
|
|
|
RemoveAttribute(entityDecl, KnownAttribute.DebuggerStepThrough); |
|
|
|
if (function.Method?.IsAccessor == true && entityDecl.Parent is EntityDeclaration parentDecl) |
|
|
|
{ |
|
|
|
RemoveAttribute(parentDecl, KnownAttribute.DebuggerStepThrough); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (function.IsAsync) |
|
|
|