Example #1
0
        public void PostAnalyzeBodyFunctionReference(IBodyFunctionReferenceAnalyzation functionReferenceAnalyzation)
        {
            if (functionReferenceAnalyzation.AsyncCounterpartSymbol?.Equals(_whenAllMethod) != true)
            {
                return;
            }
            var delegateArgument = functionReferenceAnalyzation.DelegateArguments.FirstOrDefault(o => o.Function != null);

            if (delegateArgument?.Function.Conversion.HasAnyFlag(MethodConversion.Ignore, MethodConversion.Copy) == true)
            {
                functionReferenceAnalyzation.Ignore("Delegate argument is not async");
            }
        }
Example #2
0
 public void AnalyzeInvocationExpression(InvocationExpressionSyntax invocation, IBodyFunctionReferenceAnalyzation funcReferenceResult,
                                         SemanticModel semanticModel)
 {
     if (funcReferenceResult.AsyncCounterpartSymbol?.Equals(_whenAllMethod) != true)
     {
         return;
     }
     // Ignore if the Parallel.For/ForEach return value is used
     if (!invocation.Parent.IsKind(SyntaxKind.ExpressionStatement))
     {
         funcReferenceResult.Ignore("Unable to convert to Task.WaitAll, because the return value is used");
     }
 }