1 instantiation of BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
6471
var result = new
BoundCollectionExpression
(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderInvocationPlaceholder, collectionBuilderInvocationConversion, wasTargetTyped, unconvertedCollectionExpression, elements, type, this.HasErrors);
58 references to BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (58)
Binder\Binder.ValueChecks.cs (3)
4437
return HasLocalScope((
BoundCollectionExpression
)conversion.Operand) ?
4629
private bool HasLocalScope(
BoundCollectionExpression
expr)
5223
if (HasLocalScope((
BoundCollectionExpression
)conversion.Operand) && !SafeContext.CurrentMethod.IsConvertibleTo(escapeTo))
Binder\Binder_Attributes.cs (2)
875
private TypedConstant VisitArrayCollectionExpression(TypeSymbol type,
BoundCollectionExpression
collection, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors)
918
return VisitArrayCollectionExpression(type, (
BoundCollectionExpression
)operand, diagnostics, ref attrHasErrors, curArgumentHasErrors);
Binder\Binder_Conversions.cs (5)
237
var
collectionExpression = ConvertCollectionExpression(
807
private
BoundCollectionExpression
ConvertCollectionExpression(
1641
internal static BoundExpression GetUnderlyingCollectionExpressionElement(
BoundCollectionExpression
expr, BoundExpression element, bool throwOnErrors)
1690
else if (arg is BoundConversion { Operand:
BoundCollectionExpression
{ Elements: [BoundExpression collectionElement] } })
1723
private
BoundCollectionExpression
BindCollectionExpressionForErrorRecovery(
Binder\Binder_Invocation.cs (1)
1802
BoundCollectionExpression
converted;
BoundTree\BoundNode.cs (2)
364
BoundCollectionExpression
{ WasCompilerGenerated: true, UnconvertedCollectionExpression.IsParamsArrayOrCollection: true } or
365
BoundConversion { Operand:
BoundCollectionExpression
{ IsParamsArrayOrCollection: true } });
Compilation\CSharpSemanticModel.cs (1)
2173
else if (boundExpr is
BoundCollectionExpression
convertedCollection)
FlowAnalysis\AbstractFlowPass.cs (1)
2074
public override BoundNode VisitCollectionExpression(
BoundCollectionExpression
node)
FlowAnalysis\NullableWalker.cs (8)
3844
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
3924
TypeWithState convertCollection(
BoundCollectionExpression
node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>> completions)
3951
static NullableFlowState getResultState(
BoundCollectionExpression
node, CollectionExpressionTypeKind collectionKind)
3966
(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(
BoundCollectionExpression
node, TypeSymbol collectionType)
4852
BoundCollectionExpression
{ WasTargetTyped: true };
7312
elements = ((
BoundCollectionExpression
)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>();
8270
var
collection = (
BoundCollectionExpression
)argument;
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
117
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
Generated\BoundNodes.xml.Generated.cs (10)
6467
public
BoundCollectionExpression
Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, bool wasTargetTyped, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type)
6471
var
result = new BoundCollectionExpression(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderInvocationPlaceholder, collectionBuilderInvocationConversion, wasTargetTyped, unconvertedCollectionExpression, elements, type, this.HasErrors);
9208
return VisitCollectionExpression((
BoundCollectionExpression
)node, arg);
9511
public virtual R VisitCollectionExpression(
BoundCollectionExpression
node, A arg) => this.DefaultVisit(node, arg);
9747
public virtual BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node) => this.DefaultVisit(node);
10531
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
11931
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14226
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14235
BoundCollectionExpression
updatedNode;
16655
public override TreeDumperNode VisitCollectionExpression(
BoundCollectionExpression
node, object? arg) => new TreeDumperNode("collectionExpression", null, new TreeDumperNode[]
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
1101
public override BoundNode VisitCollectionExpression(
BoundCollectionExpression
node)
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (16)
20
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
31
private BoundExpression RewriteCollectionExpressionConversion(Conversion conversion,
BoundCollectionExpression
node)
99
static bool useListOptimization(CSharpCompilation compilation,
BoundCollectionExpression
node)
133
static BoundNode unwrapListElement(
BoundCollectionExpression
node, BoundNode element)
160
private bool TryRewriteSingleElementSpreadToList(
BoundCollectionExpression
node, TypeWithAnnotations listElementType, [NotNullWhen(true)] out BoundExpression? result)
217
private static bool CanOptimizeSingleSpreadAsCollectionBuilderArgument(
BoundCollectionExpression
node, [NotNullWhen(true)] out BoundExpression? spreadExpression)
235
private BoundExpression VisitImmutableArrayCollectionExpression(
BoundCollectionExpression
node, TypeWithAnnotations elementType, MethodSymbol asImmutableArray)
246
private BoundExpression VisitArrayOrSpanCollectionExpression(
BoundCollectionExpression
node, CollectionExpressionTypeKind collectionTypeKind, TypeSymbol collectionType, TypeWithAnnotations elementType)
332
private BoundExpression VisitCollectionInitializerCollectionExpression(
BoundCollectionExpression
node, TypeSymbol collectionType)
394
private BoundExpression VisitListInterfaceCollectionExpression(
BoundCollectionExpression
node)
459
BoundExpression createArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
468
private BoundExpression VisitCollectionBuilderCollectionExpression(
BoundCollectionExpression
node)
630
private static bool ShouldUseKnownLength(
BoundCollectionExpression
node, out int numberIncludingLastSpread)
657
private BoundExpression? TryOptimizeSingleSpreadToArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
719
private BoundExpression CreateAndPopulateArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
1021
private BoundExpression CreateAndPopulateList(
BoundCollectionExpression
node, TypeWithAnnotations elementType, ImmutableArray<BoundNode> elements)
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 (5)
104
return CreateBoundCollectionExpression((
BoundCollectionExpression
)boundNode);
1223
private ICollectionExpressionOperation CreateBoundCollectionExpression(
BoundCollectionExpression
expr)
1238
static MethodSymbol? getConstructMethod(CSharpCompilation compilation,
BoundCollectionExpression
expr)
1258
private IOperation CreateBoundCollectionExpressionElement(
BoundCollectionExpression
expr, BoundNode element)
1265
private ISpreadOperation CreateBoundCollectionExpressionSpreadElement(
BoundCollectionExpression
expr, BoundCollectionExpressionSpreadElement element)