3 instantiations of BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Conversions.cs (2)
910
return new
BoundCollectionExpression
(
2310
return new
BoundCollectionExpression
(
Generated\BoundNodes.xml.Generated.cs (1)
6604
var result = new
BoundCollectionExpression
(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderElementsPlaceholder, wasTargetTyped, hasWithElement, unconvertedCollectionExpression, elements, type, this.HasErrors);
73 references to BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (73)
Binder\Binder.ValueChecks.cs (3)
4609
return GetCollectionExpressionSafeContext((
BoundCollectionExpression
)conversion.Operand);
4781
private SafeContext GetCollectionExpressionSafeContext(
BoundCollectionExpression
expr)
5347
var safeContext = GetCollectionExpressionSafeContext((
BoundCollectionExpression
)conversion.Operand);
Binder\Binder_Attributes.cs (2)
883
private TypedConstant VisitArrayCollectionExpression(TypeSymbol type,
BoundCollectionExpression
collection, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors)
926
return VisitArrayCollectionExpression(type, (
BoundCollectionExpression
)operand, diagnostics, ref attrHasErrors, curArgumentHasErrors);
Binder\Binder_Conversions.cs (13)
280
var
collectionExpression = ConvertCollectionExpression(
877
private
BoundCollectionExpression
ConvertCollectionExpression(
907
private
BoundCollectionExpression
CreateCollectionExpression(
928
public
BoundCollectionExpression
Convert()
949
var
result = TryConvertCollectionExpression(collectionTypeKind, elementType, constructor);
959
private readonly
BoundCollectionExpression
? TryConvertCollectionExpression(
1013
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionImplementsIEnumerableType(MethodSymbol? constructor)
1199
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionArrayOrSpanType(
1228
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionArrayInterfaceType(ImmutableArray<BoundNode> elements)
1316
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionBuilderType(ImmutableArray<BoundNode> elements)
2201
internal static BoundExpression GetUnderlyingCollectionExpressionElement(
BoundCollectionExpression
expr, BoundExpression element, bool throwOnErrors)
2250
else if (arg is BoundConversion { Operand:
BoundCollectionExpression
{ Elements: [BoundExpression collectionElement] } })
2283
private
BoundCollectionExpression
BindCollectionExpressionForErrorRecovery(
Binder\Binder_Invocation.cs (1)
1872
BoundCollectionExpression
converted;
Binder\RefSafetyAnalysis.cs (1)
1311
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
BoundTree\BoundNode.cs (2)
364
BoundCollectionExpression
{ WasCompilerGenerated: true, UnconvertedCollectionExpression.IsParamsArrayOrCollection: true } or
365
BoundConversion { Operand:
BoundCollectionExpression
{ IsParamsArrayOrCollection: true } });
Compilation\CSharpSemanticModel.cs (1)
2176
else if (boundExpr is
BoundCollectionExpression
convertedCollection)
FlowAnalysis\AbstractFlowPass.cs (1)
2123
public override BoundNode VisitCollectionExpression(
BoundCollectionExpression
node)
FlowAnalysis\NullableWalker.cs (10)
3894
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
3941
Action<TypeSymbol>? visitCollectionCreationArguments(
BoundCollectionExpression
node)
4049
void visitElement(BoundNode element,
BoundCollectionExpression
node, TypeWithAnnotations targetElementType, ArrayBuilder<Action<TypeWithAnnotations, TypeSymbol>> elementConversionCompletions)
4141
BoundCollectionExpression
node,
4182
static NullableFlowState getResultState(
BoundCollectionExpression
node, CollectionExpressionTypeKind collectionKind)
4197
(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(
BoundCollectionExpression
node, TypeSymbol collectionType)
5194
BoundCollectionExpression
{ WasTargetTyped: true };
7787
elements = ((
BoundCollectionExpression
)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>();
8841
var
collection = (
BoundCollectionExpression
)argument;
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
117
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
Generated\BoundNodes.xml.Generated.cs (10)
6600
public
BoundCollectionExpression
Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundCollectionBuilderElementsPlaceholder? collectionBuilderElementsPlaceholder, bool wasTargetTyped, bool hasWithElement, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type)
6604
var
result = new BoundCollectionExpression(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderElementsPlaceholder, wasTargetTyped, hasWithElement, unconvertedCollectionExpression, elements, type, this.HasErrors);
9440
return VisitCollectionExpression((
BoundCollectionExpression
)node, arg);
9750
public virtual R VisitCollectionExpression(
BoundCollectionExpression
node, A arg) => this.DefaultVisit(node, arg);
9991
public virtual BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node) => this.DefaultVisit(node);
10790
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
12222
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14536
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14544
BoundCollectionExpression
updatedNode;
17010
public override TreeDumperNode VisitCollectionExpression(
BoundCollectionExpression
node, object? arg) => new TreeDumperNode("collectionExpression", null, new TreeDumperNode[]
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
1126
public override BoundNode VisitCollectionExpression(
BoundCollectionExpression
node)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (19)
18
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
29
private BoundExpression RewriteCollectionExpressionConversion(Conversion conversion,
BoundCollectionExpression
node)
108
static bool useListOptimization(CSharpCompilation compilation,
BoundCollectionExpression
node)
142
static BoundNode unwrapListElement(
BoundCollectionExpression
node, BoundNode element)
169
private bool TryRewriteSingleElementSpreadToList(
BoundCollectionExpression
node, TypeWithAnnotations listElementType, [NotNullWhen(true)] out BoundExpression? result)
226
private static bool CanOptimizeSingleSpreadAsCollectionBuilderArgument(
BoundCollectionExpression
node, [NotNullWhen(true)] out BoundExpression? spreadExpression)
250
private BoundExpression VisitArrayOrSpanCollectionExpression(
BoundCollectionExpression
node, TypeSymbol collectionType)
288
BoundExpression createImmutableArray(
BoundCollectionExpression
node, NamedTypeSymbol immutableArrayType)
318
BoundExpression? tryCreateNonArrayBackedSpan(
BoundCollectionExpression
node, NamedTypeSymbol spanType, bool isReadOnlySpan)
358
BoundExpression createSpan(
BoundCollectionExpression
node, NamedTypeSymbol spanType, bool isReadOnlySpan)
388
BoundExpression createArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType, bool targetsReadOnlyCollection)
419
private BoundExpression VisitCollectionInitializerCollectionExpression(
BoundCollectionExpression
node, TypeSymbol collectionType)
481
private BoundExpression VisitListInterfaceCollectionExpression(
BoundCollectionExpression
node)
565
BoundExpression createArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
579
private BoundExpression VisitCollectionBuilderCollectionExpression(
BoundCollectionExpression
node)
726
private static bool ShouldUseKnownLength(
BoundCollectionExpression
node, out int numberIncludingLastSpread)
756
private BoundExpression? TryOptimizeSingleSpreadToArray_NoConversionApplied(
BoundCollectionExpression
node, bool targetsReadOnlyCollection, ArrayTypeSymbol arrayType)
825
private BoundExpression CreateAndPopulateArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
1156
BoundCollectionExpression
node,
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
62
var rewrittenCollection = RewriteCollectionExpressionConversion(node.Conversion.UnderlyingConversions[0], (
BoundCollectionExpression
)node.Operand);
66
return RewriteCollectionExpressionConversion(node.Conversion, (
BoundCollectionExpression
)node.Operand);
Operations\CSharpOperationFactory.cs (6)
103
return CreateBoundCollectionExpression((
BoundCollectionExpression
)boundNode);
1263
private ICollectionExpressionOperation CreateBoundCollectionExpression(
BoundCollectionExpression
expr)
1274
static MethodSymbol? getConstructMethod(
BoundCollectionExpression
expr)
1294
CSharpOperationFactory @this,
BoundCollectionExpression
expr)
1333
private IOperation CreateBoundCollectionExpressionElement(
BoundCollectionExpression
expr, BoundNode element)
1340
private ISpreadOperation CreateBoundCollectionExpressionSpreadElement(
BoundCollectionExpression
expr, BoundCollectionExpressionSpreadElement element)