in ClrHeapAllocationsAnalyzer/TypeConversionAllocationAnalyzer.cs [204:220]
private static void ConditionalExpressionCheck(SyntaxNode node, SemanticModel semanticModel, Action<Diagnostic> reportDiagnostic, string filePath, CancellationToken cancellationToken)
{
var conditionalExpression = node as ConditionalExpressionSyntax;
var trueExp = conditionalExpression.WhenTrue;
var falseExp = conditionalExpression.WhenFalse;
if (trueExp != null)
{
CheckTypeConversion(semanticModel.GetConversion(trueExp, cancellationToken), reportDiagnostic, trueExp.GetLocation(), filePath);
}
if (falseExp != null)
{
CheckTypeConversion(semanticModel.GetConversion(falseExp, cancellationToken), reportDiagnostic, falseExp.GetLocation(), filePath);
}
}