3 instantiations of BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Conversions.cs (2)
972return new BoundCollectionExpression( 1725return new BoundCollectionExpression(
Generated\BoundNodes.xml.Generated.cs (1)
6478var result = new BoundCollectionExpression(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderInvocationPlaceholder, collectionBuilderInvocationConversion, wasTargetTyped, unconvertedCollectionExpression, elements, type, this.HasErrors);
62 references to BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (62)
Binder\Binder.ValueChecks.cs (3)
4590return HasLocalScope((BoundCollectionExpression)conversion.Operand) ? 4770private bool HasLocalScope(BoundCollectionExpression expr) 5338if (HasLocalScope((BoundCollectionExpression)conversion.Operand) && !escapeFrom.IsConvertibleTo(escapeTo))
Binder\Binder_Attributes.cs (2)
877private TypedConstant VisitArrayCollectionExpression(TypeSymbol type, BoundCollectionExpression collection, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors) 920return VisitArrayCollectionExpression(type, (BoundCollectionExpression)operand, diagnostics, ref attrHasErrors, curArgumentHasErrors);
Binder\Binder_Conversions.cs (5)
237var collectionExpression = ConvertCollectionExpression( 807private BoundCollectionExpression ConvertCollectionExpression( 1628internal static BoundExpression GetUnderlyingCollectionExpressionElement(BoundCollectionExpression expr, BoundExpression element, bool throwOnErrors) 1677else if (arg is BoundConversion { Operand: BoundCollectionExpression { Elements: [BoundExpression collectionElement] } }) 1710private BoundCollectionExpression BindCollectionExpressionForErrorRecovery(
Binder\Binder_Invocation.cs (1)
1865BoundCollectionExpression converted;
BoundTree\BoundNode.cs (2)
364BoundCollectionExpression { WasCompilerGenerated: true, UnconvertedCollectionExpression.IsParamsArrayOrCollection: true } or 365BoundConversion { Operand: BoundCollectionExpression { IsParamsArrayOrCollection: true } });
Compilation\CSharpSemanticModel.cs (1)
2166else if (boundExpr is BoundCollectionExpression convertedCollection)
FlowAnalysis\AbstractFlowPass.cs (1)
2076public override BoundNode VisitCollectionExpression(BoundCollectionExpression node)
FlowAnalysis\NullableWalker.cs (9)
3865public override BoundNode? VisitCollectionExpression(BoundCollectionExpression node) 3902void visitElement(BoundNode element, BoundCollectionExpression node, TypeWithAnnotations targetElementType, ArrayBuilder<Func<TypeWithAnnotations, TypeSymbol, TypeWithState>> elementConversionCompletions) 3994TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeSymbol, TypeWithState>> completions) 4021static NullableFlowState getResultState(BoundCollectionExpression node, CollectionExpressionTypeKind collectionKind) 4036(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(BoundCollectionExpression node, TypeSymbol collectionType) 4964BoundCollectionExpression { WasTargetTyped: true }; 7556elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>(); 8560var collection = (BoundCollectionExpression)argument;
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
117public override BoundNode? VisitCollectionExpression(BoundCollectionExpression node)
Generated\BoundNodes.xml.Generated.cs (10)
6474public BoundCollectionExpression Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, bool wasTargetTyped, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type) 6478var result = new BoundCollectionExpression(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderInvocationPlaceholder, collectionBuilderInvocationConversion, wasTargetTyped, unconvertedCollectionExpression, elements, type, this.HasErrors); 9215return VisitCollectionExpression((BoundCollectionExpression)node, arg); 9518public virtual R VisitCollectionExpression(BoundCollectionExpression node, A arg) => this.DefaultVisit(node, arg); 9754public virtual BoundNode? VisitCollectionExpression(BoundCollectionExpression node) => this.DefaultVisit(node); 10539public override BoundNode? VisitCollectionExpression(BoundCollectionExpression node) 11941public override BoundNode? VisitCollectionExpression(BoundCollectionExpression node) 14222public override BoundNode? VisitCollectionExpression(BoundCollectionExpression node) 14231BoundCollectionExpression updatedNode; 16643public override TreeDumperNode VisitCollectionExpression(BoundCollectionExpression node, object? arg) => new TreeDumperNode("collectionExpression", null, new TreeDumperNode[]
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
1117public override BoundNode VisitCollectionExpression(BoundCollectionExpression node)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (19)
18public override BoundNode? VisitCollectionExpression(BoundCollectionExpression node) 29private BoundExpression RewriteCollectionExpressionConversion(Conversion conversion, BoundCollectionExpression node) 83static bool useListOptimization(CSharpCompilation compilation, BoundCollectionExpression node) 117static BoundNode unwrapListElement(BoundCollectionExpression node, BoundNode element) 144private bool TryRewriteSingleElementSpreadToList(BoundCollectionExpression node, TypeWithAnnotations listElementType, [NotNullWhen(true)] out BoundExpression? result) 201private static bool CanOptimizeSingleSpreadAsCollectionBuilderArgument(BoundCollectionExpression node, [NotNullWhen(true)] out BoundExpression? spreadExpression) 225private BoundExpression VisitArrayOrSpanCollectionExpression(BoundCollectionExpression node, TypeSymbol collectionType) 260BoundExpression createImmutableArray(BoundCollectionExpression node, NamedTypeSymbol immutableArrayType) 290BoundExpression? tryCreateNonArrayBackedSpan(BoundCollectionExpression node, NamedTypeSymbol spanType, bool isReadOnlySpan) 330BoundExpression createSpan(BoundCollectionExpression node, NamedTypeSymbol spanType, bool isReadOnlySpan) 360BoundExpression createArray(BoundCollectionExpression node, ArrayTypeSymbol arrayType, bool targetsReadOnlyCollection) 388private BoundExpression VisitCollectionInitializerCollectionExpression(BoundCollectionExpression node, TypeSymbol collectionType) 450private BoundExpression VisitListInterfaceCollectionExpression(BoundCollectionExpression node) 515BoundExpression createArray(BoundCollectionExpression node, ArrayTypeSymbol arrayType) 529private BoundExpression VisitCollectionBuilderCollectionExpression(BoundCollectionExpression node) 689private static bool ShouldUseKnownLength(BoundCollectionExpression node, out int numberIncludingLastSpread) 719private BoundExpression? TryOptimizeSingleSpreadToArray_NoConversionApplied(BoundCollectionExpression node, bool targetsReadOnlyCollection, ArrayTypeSymbol arrayType) 788private BoundExpression CreateAndPopulateArray(BoundCollectionExpression node, ArrayTypeSymbol arrayType) 1091private BoundExpression CreateAndPopulateList(BoundCollectionExpression node, TypeWithAnnotations elementType, ImmutableArray<BoundNode> elements)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
62var rewrittenCollection = RewriteCollectionExpressionConversion(node.Conversion.UnderlyingConversions[0], (BoundCollectionExpression)node.Operand); 66return RewriteCollectionExpressionConversion(node.Conversion, (BoundCollectionExpression)node.Operand);
Operations\CSharpOperationFactory.cs (5)
104return CreateBoundCollectionExpression((BoundCollectionExpression)boundNode); 1223private ICollectionExpressionOperation CreateBoundCollectionExpression(BoundCollectionExpression expr) 1238static MethodSymbol? getConstructMethod(CSharpCompilation compilation, BoundCollectionExpression expr) 1258private IOperation CreateBoundCollectionExpressionElement(BoundCollectionExpression expr, BoundNode element) 1265private ISpreadOperation CreateBoundCollectionExpressionSpreadElement(BoundCollectionExpression expr, BoundCollectionExpressionSpreadElement element)