/** * Check if ".Result" is accessed on a 'ValueTask' * - ignore the call if it's called inside an 'if (valueTask.IsCompletedSuccessfully)' */ public override void VisitMemberAccessExpression(MemberAccessExpressionSyntax node) { if (node.IsPropertyInvocation(ValueTaskTypes, "Result", semanticModel) && GetLeftMostIdentifier(node) is IdentifierNameSyntax identifierName && this.semanticModel.GetSymbolInfo(identifierName).Symbol is ISymbol symbol && !VerifiedForSuccessfulCompletion.Contains(symbol)) { AddToSymbolUsages(symbol, identifierName); ConsumedButNotCompleted.Add(identifierName); } base.VisitMemberAccessExpression(node); }