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)
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)
4616
return GetCollectionExpressionSafeContext((
BoundCollectionExpression
)conversion.Operand);
4785
private SafeContext GetCollectionExpressionSafeContext(
BoundCollectionExpression
expr)
5391
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)
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)
1872
BoundCollectionExpression
converted;
Binder\RefSafetyAnalysis.cs (1)
1320
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)
3930
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
3977
Action<TypeSymbol>? visitCollectionCreationArguments(
BoundCollectionExpression
node)
4087
void visitElement(BoundNode element,
BoundCollectionExpression
node, TypeWithAnnotations targetElementType, ArrayBuilder<Action<TypeWithAnnotations, TypeSymbol>> elementConversionCompletions)
4179
BoundCollectionExpression
node,
4220
static NullableFlowState getResultState(
BoundCollectionExpression
node, CollectionExpressionTypeKind collectionKind)
4235
(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(
BoundCollectionExpression
node, TypeSymbol collectionType)
5234
BoundCollectionExpression
{ WasTargetTyped: true };
7836
elements = ((
BoundCollectionExpression
)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>();
8878
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)