3 instantiations of BoundCollectionExpression
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder_Conversions.cs (2)
860
return new
BoundCollectionExpression
(
2257
return new
BoundCollectionExpression
(
Generated\BoundNodes.xml.Generated.cs (1)
6569
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)
4604
return GetCollectionExpressionSafeContext((
BoundCollectionExpression
)conversion.Operand);
4776
private SafeContext GetCollectionExpressionSafeContext(
BoundCollectionExpression
expr)
5342
var safeContext = GetCollectionExpressionSafeContext((
BoundCollectionExpression
)conversion.Operand);
Binder\Binder_Attributes.cs (2)
877
private TypedConstant VisitArrayCollectionExpression(TypeSymbol type,
BoundCollectionExpression
collection, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors)
920
return VisitArrayCollectionExpression(type, (
BoundCollectionExpression
)operand, diagnostics, ref attrHasErrors, curArgumentHasErrors);
Binder\Binder_Conversions.cs (13)
243
var
collectionExpression = ConvertCollectionExpression(
827
private
BoundCollectionExpression
ConvertCollectionExpression(
857
private
BoundCollectionExpression
CreateCollectionExpression(
878
public
BoundCollectionExpression
Convert()
899
var
result = TryConvertCollectionExpression(collectionTypeKind, elementType, constructor);
909
private readonly
BoundCollectionExpression
? TryConvertCollectionExpression(
963
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionImplementsIEnumerableType(MethodSymbol? constructor)
1149
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionArrayOrSpanType(
1178
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionArrayInterfaceType(ImmutableArray<BoundNode> elements)
1266
private readonly
BoundCollectionExpression
? TryConvertCollectionExpressionBuilderType(ImmutableArray<BoundNode> elements)
2148
internal static BoundExpression GetUnderlyingCollectionExpressionElement(
BoundCollectionExpression
expr, BoundExpression element, bool throwOnErrors)
2197
else if (arg is BoundConversion { Operand:
BoundCollectionExpression
{ Elements: [BoundExpression collectionElement] } })
2230
private
BoundCollectionExpression
BindCollectionExpressionForErrorRecovery(
Binder\Binder_Invocation.cs (1)
1871
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)
2074
public override BoundNode VisitCollectionExpression(
BoundCollectionExpression
node)
FlowAnalysis\NullableWalker.cs (10)
3866
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
3913
Action<TypeSymbol>? visitCollectionCreationArguments(
BoundCollectionExpression
node)
4021
void visitElement(BoundNode element,
BoundCollectionExpression
node, TypeWithAnnotations targetElementType, ArrayBuilder<Action<TypeWithAnnotations, TypeSymbol>> elementConversionCompletions)
4113
BoundCollectionExpression
node,
4154
static NullableFlowState getResultState(
BoundCollectionExpression
node, CollectionExpressionTypeKind collectionKind)
4169
(CollectionExpressionTypeKind, TypeWithAnnotations) getCollectionDetails(
BoundCollectionExpression
node, TypeSymbol collectionType)
5122
BoundCollectionExpression
{ WasTargetTyped: true };
7713
elements = ((
BoundCollectionExpression
)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>();
8717
var
collection = (
BoundCollectionExpression
)argument;
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
117
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
Generated\BoundNodes.xml.Generated.cs (10)
6565
public
BoundCollectionExpression
Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundCollectionBuilderElementsPlaceholder? collectionBuilderElementsPlaceholder, bool wasTargetTyped, bool hasWithElement, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type)
6569
var
result = new BoundCollectionExpression(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderElementsPlaceholder, wasTargetTyped, hasWithElement, unconvertedCollectionExpression, elements, type, this.HasErrors);
9314
return VisitCollectionExpression((
BoundCollectionExpression
)node, arg);
9619
public virtual R VisitCollectionExpression(
BoundCollectionExpression
node, A arg) => this.DefaultVisit(node, arg);
9857
public virtual BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node) => this.DefaultVisit(node);
10649
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
12064
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14362
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14370
BoundCollectionExpression
updatedNode;
16799
public override TreeDumperNode VisitCollectionExpression(
BoundCollectionExpression
node, object? arg) => new TreeDumperNode("collectionExpression", null, new TreeDumperNode[]
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
1117
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);
1238
private ICollectionExpressionOperation CreateBoundCollectionExpression(
BoundCollectionExpression
expr)
1249
static MethodSymbol? getConstructMethod(
BoundCollectionExpression
expr)
1269
CSharpOperationFactory @this,
BoundCollectionExpression
expr)
1308
private IOperation CreateBoundCollectionExpressionElement(
BoundCollectionExpression
expr, BoundNode element)
1315
private ISpreadOperation CreateBoundCollectionExpressionSpreadElement(
BoundCollectionExpression
expr, BoundCollectionExpressionSpreadElement element)