Skip to content

Commit

Permalink
Fix general using statement pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Jul 20, 2024
1 parent d0bdf18 commit 427fbcd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ICSharpCode.Decompiler/IL/Transforms/UsingTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,17 @@ bool MatchDisposeCheck(ILVariable objVar, ILInstruction checkInst, bool isRefere
}
if (disposeCall.Method.IsStatic)
return false;
if (disposeCall.Method.Name != "DisposeAsync")
return false;
if (disposeTypeCode == KnownTypeCode.IAsyncDisposable)
{
if (disposeCall.Method.Name != "DisposeAsync")
return false;
}
else
{
if (disposeCall.Method.FullName != disposeMethodFullName)
return false;
}

if (disposeCall.Method.Parameters.Count > 0)
return false;
if (disposeCall.Arguments.Count != 1)
Expand Down

0 comments on commit 427fbcd

Please sign in to comment.