3 instantiations of BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Conversions.cs (2)
918
return new
BoundCollectionExpression
(
2335
return new
BoundCollectionExpression
(
Generated\BoundNodes.xml.Generated.cs (1)
6585
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_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)
281
var
collectionExpression = ConvertCollectionExpression(
885
private
BoundCollectionExpression
ConvertCollectionExpression(
915
private
BoundCollectionExpression
CreateCollectionExpression(
936
public
BoundCollectionExpression
Convert()
957
var
result = TryConvertCollectionExpression(collectionTypeKind, elementType, constructor);
967
private readonly
BoundCollectionExpression
? TryConvertCollectionExpression(
1021
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionImplementsIEnumerableType(MethodSymbol? constructor)
1217
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionArrayOrSpanType(
1246
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionArrayInterfaceType(ImmutableArray<BoundNode> elements)
1340
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionBuilderType(ImmutableArray<BoundNode> elements)
2226
internal static BoundExpression GetUnderlyingCollectionExpressionElement(
BoundCollectionExpression
expr, BoundExpression element, bool throwOnErrors)
2275
else if (arg is BoundConversion { Operand:
BoundCollectionExpression
{ Elements: [BoundExpression collectionElement] } })
2308
private
BoundCollectionExpression
BindCollectionExpressionForErrorRecovery(
Binder\Binder_Invocation.cs (1)
1897
BoundCollectionExpression
converted;
Binder\Binder.ValueChecks.cs (3)
4604
return GetCollectionExpressionSafeContext((
BoundCollectionExpression
)conversion.Operand);
4773
private SafeContext GetCollectionExpressionSafeContext(
BoundCollectionExpression
expr)
5383
var safeContext = GetCollectionExpressionSafeContext((
BoundCollectionExpression
)conversion.Operand);
Binder\RefSafetyAnalysis.cs (1)
1353
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)
2075
public override BoundNode VisitCollectionExpression(
BoundCollectionExpression
node)
FlowAnalysis\NullableWalker.cs (10)
3981
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
4028
Action<TypeSymbol>? visitCollectionCreationArguments(
BoundCollectionExpression
node)
4138
void visitElement(BoundNode element,
BoundCollectionExpression
node, TypeWithAnnotations targetElementType, ArrayBuilder<Action<TypeWithAnnotations, TypeSymbol>> elementConversionCompletions)
4230
BoundCollectionExpression
node,
4271
static NullableFlowState getResultState(
BoundCollectionExpression
node, CollectionExpressionTypeKind collectionKind)
4286
(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(
BoundCollectionExpression
node, TypeSymbol collectionType)
5274
BoundCollectionExpression
{ WasTargetTyped: true };
7921
elements = ((
BoundCollectionExpression
)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>();
8963
var
collection = (
BoundCollectionExpression
)argument;
Generated\BoundNodes.xml.Generated.cs (10)
6581
public
BoundCollectionExpression
Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundCollectionBuilderElementsPlaceholder? collectionBuilderElementsPlaceholder, bool wasTargetTyped, bool hasWithElement, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type)
6585
var
result = new BoundCollectionExpression(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderElementsPlaceholder, wasTargetTyped, hasWithElement, unconvertedCollectionExpression, elements, type, this.HasErrors);
9419
return VisitCollectionExpression((
BoundCollectionExpression
)node, arg);
9729
public virtual R VisitCollectionExpression(
BoundCollectionExpression
node, A arg) => this.DefaultVisit(node, arg);
9970
public virtual BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node) => this.DefaultVisit(node);
10781
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
12216
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14535
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14543
BoundCollectionExpression
updatedNode;
17012
public override TreeDumperNode VisitCollectionExpression(
BoundCollectionExpression
node, object? arg) => new TreeDumperNode("collectionExpression", null, new TreeDumperNode[]
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
1132
public override BoundNode VisitCollectionExpression(
BoundCollectionExpression
node)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (20)
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? tryCreateOptimizedArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType, bool targetsReadOnlyCollection)
374
BoundExpression createSpan(
BoundCollectionExpression
node, NamedTypeSymbol spanType, bool isReadOnlySpan)
444
BoundExpression createArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType, bool targetsReadOnlyCollection)
470
private BoundExpression VisitCollectionInitializerCollectionExpression(
BoundCollectionExpression
node, TypeSymbol collectionType)
532
private BoundExpression VisitListInterfaceCollectionExpression(
BoundCollectionExpression
node)
616
BoundExpression createArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
630
private BoundExpression VisitCollectionBuilderCollectionExpression(
BoundCollectionExpression
node)
777
private static bool ShouldUseKnownLength(
BoundCollectionExpression
node, out int numberIncludingLastSpread)
807
private BoundExpression? TryOptimizeSingleSpreadToArray_NoConversionApplied(
BoundCollectionExpression
node, bool targetsReadOnlyCollection, ArrayTypeSymbol arrayType)
876
private BoundExpression CreateAndPopulateArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
1207
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);
1282
private ICollectionExpressionOperation CreateBoundCollectionExpression(
BoundCollectionExpression
expr)
1293
static MethodSymbol? getConstructMethod(
BoundCollectionExpression
expr)
1313
CSharpOperationFactory @this,
BoundCollectionExpression
expr)
1352
private IOperation CreateBoundCollectionExpressionElement(
BoundCollectionExpression
expr, BoundNode element)
1359
private ISpreadOperation CreateBoundCollectionExpressionSpreadElement(
BoundCollectionExpression
expr, BoundCollectionExpressionSpreadElement element)