1 write to Elements
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
6476this.Elements = elements;
59 references to Elements
Microsoft.CodeAnalysis.CSharp (59)
Binder\Binder_Attributes.cs (1)
886var elements = collection.Elements;
Binder\Binder_Conversions.cs (6)
1052var elements = _node.Elements; 1154var elements = _node.Elements; 2275else if (arg is BoundConversion { Operand: BoundCollectionExpression { Elements: [BoundExpression collectionElement] } }) 2326var elementsBuilder = ArrayBuilder<BoundNode>.GetInstance(node.Elements.Length); 2328foreach (var element in node.Elements) 2384var elements = node.Elements;
Binder\Binder.ValueChecks.cs (2)
4766if (!expr.HasWithElement && expr.Elements.IsEmpty) 4803foreach (var element in expr.Elements)
Binder\RefSafetyAnalysis.cs (4)
1415var safeContext = node.Elements.Length == 0 || LocalRewriter.ShouldUseRuntimeHelpersCreateSpan(node, elementType.Type) 1437VisitList(node.Elements); 1449foreach (var element in node.Elements) 1501if (node.CollectionCreation is BoundObjectCreationExpression { Constructor: { } } objectCreation && !node.Elements.IsEmpty)
Binder\Semantics\Conversions\Conversions.cs (1)
186var elements = node.Elements;
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (4)
677if (argument.Elements.Length == 0) 687foreach (var element in argument.Elements) 902if (argument.Elements.Length == 0) 912foreach (var element in argument.Elements)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
3074collectionExpression.Elements,
BoundTree\BoundCollectionExpression.cs (3)
70foreach (var element in Elements) 85for (int i = 0; i < Elements.Length; i++) 87if (Elements[i] is BoundCollectionExpressionSpreadElement spreadElement)
BoundTree\BoundNode.cs (2)
368ImmutableArray<BoundNode>.CastUp(collection.Elements.CastArray<BoundExpression>()) == collection.Elements);
FlowAnalysis\AbstractFlowPass.cs (2)
2088VisitCollectionExpression(node.Elements); 2094VisitCollectionExpression(node.Elements);
FlowAnalysis\NullableWalker.cs (6)
3991var resultBuilder = ArrayBuilder<VisitResult>.GetInstance(node.Elements.Length); 3993foreach (var element in node.Elements) 7938elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>(); 8983Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length); 8988if (collection.Elements[i] is BoundExpression elementExpression) 8995elementsBuilder.Add(collection.Elements[i]);
Generated\BoundNodes.xml.Generated.cs (10)
6505if (withElement != this.WithElement || elements != this.Elements) 6586if (collectionTypeKind != this.CollectionTypeKind || placeholder != this.Placeholder || collectionCreation != this.CollectionCreation || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(collectionBuilderMethod, this.CollectionBuilderMethod) || collectionBuilderElementsPlaceholder != this.CollectionBuilderElementsPlaceholder || wasTargetTyped != this.WasTargetTyped || hasWithElement != this.HasWithElement || unconvertedCollectionExpression != this.UnconvertedCollectionExpression || elements != this.Elements || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) 10776this.VisitList(node.Elements); 10787this.VisitList(node.Elements); 12210ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 12226ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 14523ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 14545ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 17002new TreeDumperNode("elements", null, from x in node.Elements select Visit(x, null)), 17026new TreeDumperNode("elements", null, from x in node.Elements select Visit(x, null)),
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (16)
69node.Elements.SelectAsArray(static (element, node) => unwrapListElement(node, element), node), 105var elements = node.Elements; 168if (node.Elements is not [BoundCollectionExpressionSpreadElement singleSpread]) 228Elements: [BoundCollectionExpressionSpreadElement { Expression: { Type: NamedTypeSymbol spreadType } expr }], 285var elements = node.Elements; 339var elements = node.Elements; 405var list = CreateAndPopulateList(node, elementType, node.Elements, 468var list = CreateAndPopulateList(node, arrayType.ElementTypeWithAnnotations, node.Elements, 488var elements = node.Elements; 558var elements = node.Elements; 680&& node.Elements.Length > 0 689node.Elements.Length > 0 && 691node.Elements.All(e => ((BoundExpression)e).ConstantValueOpt is { }); 697node.Elements.Length > 0 && 825if (node is { Elements: [BoundCollectionExpressionSpreadElement { Expression: { } spreadExpression } spreadElement] } 893var elements = node.Elements;
Operations\CSharpOperationFactory.cs (1)
1287expr.Elements.SelectAsArray((element, expr) => CreateBoundCollectionExpressionElement(expr, element), expr),