1 write to Elements
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
6459this.Elements = elements;
57 references to Elements
Microsoft.CodeAnalysis.CSharp (57)
Binder\Binder.ValueChecks.cs (1)
4785if (!expr.HasWithElement && expr.Elements.IsEmpty)
Binder\Binder_Attributes.cs (1)
880var elements = collection.Elements;
Binder\Binder_Conversions.cs (6)
993var elements = _node.Elements; 1086var elements = _node.Elements; 2197else if (arg is BoundConversion { Operand: BoundCollectionExpression { Elements: [BoundExpression collectionElement] } }) 2248var elementsBuilder = ArrayBuilder<BoundNode>.GetInstance(node.Elements.Length); 2250foreach (var element in node.Elements) 2306var elements = node.Elements;
Binder\RefSafetyAnalysis.cs (2)
1322var safeContext = node.Elements.Length == 0 || LocalRewriter.ShouldUseRuntimeHelpersCreateSpan(node, elementType.Type) 1338VisitList(node.Elements);
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)
3072collectionExpression.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)
2077VisitCollectionExpression(node.Elements); 2083VisitCollectionExpression(node.Elements);
FlowAnalysis\NullableWalker.cs (6)
3883var resultBuilder = ArrayBuilder<VisitResult>.GetInstance(node.Elements.Length); 3885foreach (var element in node.Elements) 7713elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>(); 8720Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length); 8725if (collection.Elements[i] is BoundExpression elementExpression) 8732elementsBuilder.Add(collection.Elements[i]);
FlowAnalysis\NullableWalker.DebugVerifier.cs (2)
122this.VisitList(node.UnconvertedCollectionExpression.Elements); 129foreach (var element in node.Elements)
Generated\BoundNodes.xml.Generated.cs (10)
6488if (withElement != this.WithElement || elements != this.Elements) 6569if (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)) 10643this.VisitList(node.Elements); 10654this.VisitList(node.Elements); 12057ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 12073ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 14349ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 14371ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 16788new TreeDumperNode("elements", null, from x in node.Elements select Visit(x, null)), 16812new TreeDumperNode("elements", null, from x in node.Elements select Visit(x, null)),
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (15)
74node.Elements.SelectAsArray(static (element, node) => unwrapListElement(node, element), node), 110var elements = node.Elements; 173if (node.Elements is not [BoundCollectionExpressionSpreadElement singleSpread]) 233Elements: [BoundCollectionExpressionSpreadElement { Expression: { Type: NamedTypeSymbol spreadType } expr }], 290if (node.Elements.IsEmpty && 325var elements = node.Elements; 403var list = CreateAndPopulateList(node, arrayType.ElementTypeWithAnnotations, node.Elements, 423var elements = node.Elements; 493var elements = node.Elements; 615&& node.Elements.Length > 0 624node.Elements.Length > 0 && 626node.Elements.All(e => ((BoundExpression)e).ConstantValueOpt is { }); 632node.Elements.Length > 0 && 760if (node is { Elements: [BoundCollectionExpressionSpreadElement { Expression: { } spreadExpression } spreadElement] } 828var elements = node.Elements;
Operations\CSharpOperationFactory.cs (1)
1243expr.Elements.SelectAsArray((element, expr) => CreateBoundCollectionExpressionElement(expr, element), expr),