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)
6587
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)
1909
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)
6583
public
BoundCollectionExpression
Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundCollectionBuilderElementsPlaceholder? collectionBuilderElementsPlaceholder, bool wasTargetTyped, bool hasWithElement, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type)
6587
var
result = new BoundCollectionExpression(this.Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderElementsPlaceholder, wasTargetTyped, hasWithElement, unconvertedCollectionExpression, elements, type, this.HasErrors);
9421
return VisitCollectionExpression((
BoundCollectionExpression
)node, arg);
9731
public virtual R VisitCollectionExpression(
BoundCollectionExpression
node, A arg) => this.DefaultVisit(node, arg);
9972
public virtual BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node) => this.DefaultVisit(node);
10783
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
12218
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14537
public override BoundNode? VisitCollectionExpression(
BoundCollectionExpression
node)
14545
BoundCollectionExpression
updatedNode;
17015
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)
103
static bool useListOptimization(CSharpCompilation compilation,
BoundCollectionExpression
node)
137
static BoundNode unwrapListElement(
BoundCollectionExpression
node, BoundNode element)
164
private bool TryRewriteSingleElementSpreadToList(
BoundCollectionExpression
node, TypeWithAnnotations listElementType, [NotNullWhen(true)] out BoundExpression? result)
221
private static bool CanOptimizeSingleSpreadAsCollectionBuilderArgument(
BoundCollectionExpression
node, [NotNullWhen(true)] out BoundExpression? spreadExpression)
245
private BoundExpression VisitArrayOrSpanCollectionExpression(
BoundCollectionExpression
node, TypeSymbol collectionType)
283
BoundExpression createImmutableArray(
BoundCollectionExpression
node, NamedTypeSymbol immutableArrayType)
332
BoundExpression? tryCreateNonArrayBackedSpan(
BoundCollectionExpression
node, NamedTypeSymbol spanType, bool isReadOnlySpan)
372
BoundExpression? tryCreateOptimizedArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType, bool targetsReadOnlyCollection)
388
BoundExpression createSpan(
BoundCollectionExpression
node, NamedTypeSymbol spanType, bool isReadOnlySpan)
458
BoundExpression createArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType, bool targetsReadOnlyCollection)
484
private BoundExpression VisitCollectionInitializerCollectionExpression(
BoundCollectionExpression
node, TypeSymbol collectionType)
546
private BoundExpression VisitListInterfaceCollectionExpression(
BoundCollectionExpression
node)
630
BoundExpression createArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
644
private BoundExpression VisitCollectionBuilderCollectionExpression(
BoundCollectionExpression
node)
791
private static bool ShouldUseKnownLength(
BoundCollectionExpression
node, out int numberIncludingLastSpread)
821
private BoundExpression? TryOptimizeSingleSpreadToArray_NoConversionApplied(
BoundCollectionExpression
node, bool targetsReadOnlyCollection, ArrayTypeSymbol arrayType)
890
private BoundExpression CreateAndPopulateArray(
BoundCollectionExpression
node, ArrayTypeSymbol arrayType)
1221
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)