Files
PURErat-crack-scode/decompiled/Libraries/microsoft.codeanalysis.csharp/Microsoft.CodeAnalysis.CSharp/BoundCollectionExpression.cs
T

51 lines
3.1 KiB
C#
Raw Normal View History

2026-08-27 10:56:38 -06:00
using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.CodeAnalysis.CSharp.Symbols;
namespace Microsoft.CodeAnalysis.CSharp;
internal sealed class BoundCollectionExpression : BoundCollectionExpressionBase
{
public new TypeSymbol Type => base.Type;
public CollectionExpressionTypeKind CollectionTypeKind { get; }
public BoundObjectOrCollectionValuePlaceholder? Placeholder { get; }
public BoundExpression? CollectionCreation { get; }
public MethodSymbol? CollectionBuilderMethod { get; }
public BoundValuePlaceholder? CollectionBuilderInvocationPlaceholder { get; }
public BoundExpression? CollectionBuilderInvocationConversion { get; }
public BoundCollectionExpression(SyntaxNode syntax, CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, ImmutableArray<BoundExpression> elements, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.CollectionExpression, syntax, elements, type, hasErrors || placeholder.HasErrors() || collectionCreation.HasErrors() || collectionBuilderInvocationPlaceholder.HasErrors() || collectionBuilderInvocationConversion.HasErrors() || elements.HasErrors())
{
CollectionTypeKind = collectionTypeKind;
Placeholder = placeholder;
CollectionCreation = collectionCreation;
CollectionBuilderMethod = collectionBuilderMethod;
CollectionBuilderInvocationPlaceholder = collectionBuilderInvocationPlaceholder;
CollectionBuilderInvocationConversion = collectionBuilderInvocationConversion;
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor)
{
return visitor.VisitCollectionExpression(this);
}
public BoundCollectionExpression Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, ImmutableArray<BoundExpression> elements, TypeSymbol type)
{
if (collectionTypeKind != CollectionTypeKind || placeholder != Placeholder || collectionCreation != CollectionCreation || !SymbolEqualityComparer.ConsiderEverything.Equals(collectionBuilderMethod, CollectionBuilderMethod) || collectionBuilderInvocationPlaceholder != CollectionBuilderInvocationPlaceholder || collectionBuilderInvocationConversion != CollectionBuilderInvocationConversion || elements != base.Elements || !TypeSymbol.Equals(type, Type, (TypeCompareKind)0))
{
BoundCollectionExpression boundCollectionExpression = new BoundCollectionExpression(Syntax, collectionTypeKind, placeholder, collectionCreation, collectionBuilderMethod, collectionBuilderInvocationPlaceholder, collectionBuilderInvocationConversion, elements, type, base.HasErrors);
boundCollectionExpression.CopyAttributes(this);
return boundCollectionExpression;
}
return this;
}
}