Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AZC0004 ensure that method signatures match #9388

Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,22 @@ private static bool DoReturnTypesMatch(ITypeSymbol asyncReturnType, ITypeSymbol
else
{
var asyncInnerType = asyncNamedType.TypeArguments.FirstOrDefault();

string asyncInnerTypeName = asyncNamedType.Name;
JonathanCrd marked this conversation as resolved.
Show resolved Hide resolved

return SymbolEqualityComparer.Default.Equals(asyncInnerType, syncReturnType);

}
}

// Add scenario to handle AsyncPageable<T> and Pageable<T> return types
if (asyncReturnType is INamedTypeSymbol asyncNamedTypeSymbol && asyncNamedTypeSymbol.IsGenericType && asyncNamedTypeSymbol.Name == AsyncPageableTypeName)
{
if (syncReturnType is INamedTypeSymbol syncNamedTypeSymbol && syncNamedTypeSymbol.IsGenericType && syncNamedTypeSymbol.Name == PageableTypeName)
{
var asyncInnerType = asyncNamedTypeSymbol.TypeArguments.Single();
var syncInnerType = syncNamedTypeSymbol.TypeArguments.Single();
return SymbolEqualityComparer.Default.Equals(asyncInnerType, syncInnerType);
}
}

Expand Down
Loading