1 write to Elements
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
6475this.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)
4782if (!expr.HasWithElement && expr.Elements.IsEmpty) 4819foreach (var element in expr.Elements)
Binder\RefSafetyAnalysis.cs (4)
1366var safeContext = node.Elements.Length == 0 || LocalRewriter.ShouldUseRuntimeHelpersCreateSpan(node, elementType.Type) 1388VisitList(node.Elements); 1400foreach (var element in node.Elements) 1452if (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)
2078VisitCollectionExpression(node.Elements); 2084VisitCollectionExpression(node.Elements);
FlowAnalysis\NullableWalker.cs (6)
3998var resultBuilder = ArrayBuilder<VisitResult>.GetInstance(node.Elements.Length); 4000foreach (var element in node.Elements) 7921elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>(); 8966Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length); 8971if (collection.Elements[i] is BoundExpression elementExpression) 8978elementsBuilder.Add(collection.Elements[i]);
Generated\BoundNodes.xml.Generated.cs (10)
6504if (withElement != this.WithElement || elements != this.Elements) 6585if (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)) 10775this.VisitList(node.Elements); 10786this.VisitList(node.Elements); 12209ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 12225ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 14522ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 14544ImmutableArray<BoundNode> elements = this.VisitList(node.Elements); 17001new TreeDumperNode("elements", null, from x in node.Elements select Visit(x, null)), 17025new 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),