private bool CheckExpression(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); // TODO(cyrusn): This is probably unnecessary. What we should be doing is binding // the type of the expression and seeing if it contains an anonymous type. if (expression is AnonymousObjectCreationExpressionSyntax) { return(false); } return(expression.CanReplaceWithRValue(semanticModel, cancellationToken)); }
private bool CheckExpression(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); // TODO(cyrusn): This is probably unnecessary. What we should be doing is binding // the type of the expression and seeing if it contains an anonymous type. if (expression is AnonymousObjectCreationExpressionSyntax) { return false; } return expression.CanReplaceWithRValue(semanticModel, cancellationToken); }