ErrorProne.NET
ErrorProne.NET copied to clipboard
Warn if a method is calling itself with same arguments (infinite recursion)
Arhh... Got the same issue myself with infinite recursion! Will definitely create a rule to catch this!
The test case:
protected async Task<TResult> PerformOperationAsync<TResult, TResponse>(
OperationContext context,
Func<SessionContext, AsyncUnaryCall<TResponse>> func,
Func<TResponse, TResult> responseHandler)
where TResult : ResultBase
where TResponse : IGrpcResponse
{
var sessionContext = await CreateSessionContextAsync(context, context.Token);
if (!sessionContext)
{
return new ErrorResult(sessionContext).AsResult<TResult>();
}
return await PerformOperationAsync(context, func, responseHandler);
}