diff --git a/src/Zomp.SyncMethodGenerator/AsyncToSyncRewriter.cs b/src/Zomp.SyncMethodGenerator/AsyncToSyncRewriter.cs index 1a379bf..a1cea63 100644 --- a/src/Zomp.SyncMethodGenerator/AsyncToSyncRewriter.cs +++ b/src/Zomp.SyncMethodGenerator/AsyncToSyncRewriter.cs @@ -27,6 +27,7 @@ internal sealed class AsyncToSyncRewriter(SemanticModel semanticModel) : CSharpS private const string IAsyncEnumerator = "System.Collections.Generic.IAsyncEnumerator"; private const string FromResult = "FromResult"; private const string Delay = "Delay"; + private const string CompletedTask = "CompletedTask"; private static readonly HashSet Drops = [IProgressInterface, CancellationTokenType]; private static readonly HashSet InterfacesToDrop = [IProgressInterface, IAsyncResultInterface]; private static readonly Dictionary Replacements = new() @@ -1178,7 +1179,7 @@ private static bool ShouldRemoveType(ITypeSymbol symbol) private static bool ShouldRemoveArgument(ISymbol symbol) => symbol switch { - IPropertySymbol { Name: "CompletedTask" } ps => ps.Type.ToString() is TaskType or ValueTaskType, + IPropertySymbol { Name: CompletedTask } ps => ps.Type.ToString() is TaskType or ValueTaskType, IMethodSymbol ms => IsSpecialMethod(ms) == SpecialMethod.None && ((ShouldRemoveType(ms.ReturnType) && ms.MethodKind != MethodKind.LocalFunction)