//
#nullable enable
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Text;
using Microsoft.CodeAnalysis.Collections;
using Roslyn.Utilities;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Microsoft.CodeAnalysis.CSharp
{
internal enum BoundKind: byte
{
FieldEqualsValue,
PropertyEqualsValue,
ParameterEqualsValue,
GlobalStatementInitializer,
DeconstructValuePlaceholder,
TupleOperandPlaceholder,
AwaitableValuePlaceholder,
DisposableValuePlaceholder,
ObjectOrCollectionValuePlaceholder,
Dup,
PassByCopy,
BadExpression,
BadStatement,
ExtractedFinallyBlock,
TypeExpression,
TypeOrValueExpression,
NamespaceExpression,
UnaryOperator,
IncrementOperator,
AddressOfOperator,
PointerIndirectionOperator,
PointerElementAccess,
RefTypeOperator,
MakeRefOperator,
RefValueOperator,
FromEndIndexExpression,
RangeExpression,
BinaryOperator,
TupleBinaryOperator,
UserDefinedConditionalLogicalOperator,
CompoundAssignmentOperator,
AssignmentOperator,
DeconstructionAssignmentOperator,
NullCoalescingOperator,
NullCoalescingAssignmentOperator,
ConditionalOperator,
ArrayAccess,
ArrayLength,
AwaitableInfo,
AwaitExpression,
TypeOfOperator,
MethodDefIndex,
MaximumMethodDefIndex,
InstrumentationPayloadRoot,
ModuleVersionId,
ModuleVersionIdString,
SourceDocumentIndex,
MethodInfo,
FieldInfo,
DefaultLiteral,
DefaultExpression,
IsOperator,
AsOperator,
SizeOfOperator,
Conversion,
ReadOnlySpanFromArray,
ArgList,
ArgListOperator,
FixedLocalCollectionInitializer,
SequencePoint,
SequencePointWithSpan,
Block,
Scope,
StateMachineScope,
LocalDeclaration,
MultipleLocalDeclarations,
UsingLocalDeclarations,
LocalFunctionStatement,
NoOpStatement,
ReturnStatement,
YieldReturnStatement,
YieldBreakStatement,
ThrowStatement,
ExpressionStatement,
BreakStatement,
ContinueStatement,
SwitchStatement,
SwitchDispatch,
IfStatement,
DoStatement,
WhileStatement,
ForStatement,
ForEachStatement,
ForEachDeconstructStep,
UsingStatement,
FixedStatement,
LockStatement,
TryStatement,
CatchBlock,
Literal,
ThisReference,
PreviousSubmissionReference,
HostObjectMemberReference,
BaseReference,
Local,
PseudoVariable,
RangeVariable,
Parameter,
LabelStatement,
GotoStatement,
LabeledStatement,
Label,
StatementList,
ConditionalGoto,
SwitchExpressionArm,
UnconvertedSwitchExpression,
ConvertedSwitchExpression,
DecisionDag,
EvaluationDecisionDagNode,
TestDecisionDagNode,
WhenDecisionDagNode,
LeafDecisionDagNode,
DagTemp,
DagTypeTest,
DagNonNullTest,
DagExplicitNullTest,
DagValueTest,
DagDeconstructEvaluation,
DagTypeEvaluation,
DagFieldEvaluation,
DagPropertyEvaluation,
DagIndexEvaluation,
SwitchSection,
SwitchLabel,
SequencePointExpression,
Sequence,
SpillSequence,
DynamicMemberAccess,
DynamicInvocation,
ConditionalAccess,
LoweredConditionalAccess,
ConditionalReceiver,
ComplexConditionalReceiver,
MethodGroup,
PropertyGroup,
Call,
EventAssignmentOperator,
Attribute,
ObjectCreationExpression,
TupleLiteral,
ConvertedTupleLiteral,
DynamicObjectCreationExpression,
NoPiaObjectCreationExpression,
ObjectInitializerExpression,
ObjectInitializerMember,
DynamicObjectInitializerMember,
CollectionInitializerExpression,
CollectionElementInitializer,
DynamicCollectionElementInitializer,
ImplicitReceiver,
AnonymousObjectCreationExpression,
AnonymousPropertyDeclaration,
NewT,
DelegateCreationExpression,
ArrayCreation,
ArrayInitialization,
StackAllocArrayCreation,
ConvertedStackAllocExpression,
FieldAccess,
HoistedFieldAccess,
PropertyAccess,
EventAccess,
IndexerAccess,
IndexOrRangePatternIndexerAccess,
DynamicIndexerAccess,
Lambda,
UnboundLambda,
QueryClause,
TypeOrInstanceInitializers,
NameOfOperator,
InterpolatedString,
StringInsert,
IsPatternExpression,
ConstantPattern,
DiscardPattern,
DeclarationPattern,
RecursivePattern,
ITuplePattern,
Subpattern,
DiscardExpression,
ThrowExpression,
OutVariablePendingInference,
DeconstructionVariablePendingInference,
OutDeconstructVarPendingInference,
NonConstructorMethodBody,
ConstructorMethodBody,
ExpressionWithNullability,
}
internal abstract partial class BoundInitializer : BoundNode
{
protected BoundInitializer(BoundKind kind, SyntaxNode syntax, bool hasErrors)
: base(kind, syntax, hasErrors)
{
}
protected BoundInitializer(BoundKind kind, SyntaxNode syntax)
: base(kind, syntax)
{
}
}
internal abstract partial class BoundEqualsValue : BoundInitializer
{
protected BoundEqualsValue(BoundKind kind, SyntaxNode syntax, ImmutableArray locals, BoundExpression value, bool hasErrors = false)
: base(kind, syntax, hasErrors)
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.Value = value;
}
public ImmutableArray Locals { get; }
public BoundExpression Value { get; }
}
internal sealed partial class BoundFieldEqualsValue : BoundEqualsValue
{
public BoundFieldEqualsValue(SyntaxNode syntax, FieldSymbol field, ImmutableArray locals, BoundExpression value, bool hasErrors = false)
: base(BoundKind.FieldEqualsValue, syntax, locals, value, hasErrors || value.HasErrors())
{
Debug.Assert(field is object, "Field 'field' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Field = field;
}
public FieldSymbol Field { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitFieldEqualsValue(this);
public BoundFieldEqualsValue Update(FieldSymbol field, ImmutableArray locals, BoundExpression value)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(field, this.Field) || locals != this.Locals || value != this.Value)
{
var result = new BoundFieldEqualsValue(this.Syntax, field, locals, value, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundPropertyEqualsValue : BoundEqualsValue
{
public BoundPropertyEqualsValue(SyntaxNode syntax, PropertySymbol property, ImmutableArray locals, BoundExpression value, bool hasErrors = false)
: base(BoundKind.PropertyEqualsValue, syntax, locals, value, hasErrors || value.HasErrors())
{
Debug.Assert(property is object, "Field 'property' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Property = property;
}
public PropertySymbol Property { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitPropertyEqualsValue(this);
public BoundPropertyEqualsValue Update(PropertySymbol property, ImmutableArray locals, BoundExpression value)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(property, this.Property) || locals != this.Locals || value != this.Value)
{
var result = new BoundPropertyEqualsValue(this.Syntax, property, locals, value, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundParameterEqualsValue : BoundEqualsValue
{
public BoundParameterEqualsValue(SyntaxNode syntax, ParameterSymbol parameter, ImmutableArray locals, BoundExpression value, bool hasErrors = false)
: base(BoundKind.ParameterEqualsValue, syntax, locals, value, hasErrors || value.HasErrors())
{
Debug.Assert(parameter is object, "Field 'parameter' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Parameter = parameter;
}
public ParameterSymbol Parameter { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitParameterEqualsValue(this);
public BoundParameterEqualsValue Update(ParameterSymbol parameter, ImmutableArray locals, BoundExpression value)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(parameter, this.Parameter) || locals != this.Locals || value != this.Value)
{
var result = new BoundParameterEqualsValue(this.Syntax, parameter, locals, value, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundGlobalStatementInitializer : BoundInitializer
{
public BoundGlobalStatementInitializer(SyntaxNode syntax, BoundStatement statement, bool hasErrors = false)
: base(BoundKind.GlobalStatementInitializer, syntax, hasErrors || statement.HasErrors())
{
Debug.Assert(statement is object, "Field 'statement' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Statement = statement;
}
public BoundStatement Statement { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitGlobalStatementInitializer(this);
public BoundGlobalStatementInitializer Update(BoundStatement statement)
{
if (statement != this.Statement)
{
var result = new BoundGlobalStatementInitializer(this.Syntax, statement, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundExpression : BoundNode
{
protected BoundExpression(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
: base(kind, syntax, hasErrors)
{
this.Type = type;
}
protected BoundExpression(BoundKind kind, SyntaxNode syntax, TypeSymbol? type)
: base(kind, syntax)
{
this.Type = type;
}
public TypeSymbol? Type { get; }
}
internal abstract partial class BoundValuePlaceholderBase : BoundExpression
{
protected BoundValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
: base(kind, syntax, type, hasErrors)
{
}
protected BoundValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol? type)
: base(kind, syntax, type)
{
}
}
internal sealed partial class BoundDeconstructValuePlaceholder : BoundValuePlaceholderBase
{
public BoundDeconstructValuePlaceholder(SyntaxNode syntax, uint valEscape, TypeSymbol type, bool hasErrors)
: base(BoundKind.DeconstructValuePlaceholder, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ValEscape = valEscape;
}
public BoundDeconstructValuePlaceholder(SyntaxNode syntax, uint valEscape, TypeSymbol type)
: base(BoundKind.DeconstructValuePlaceholder, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ValEscape = valEscape;
}
public new TypeSymbol Type => base.Type!;
public uint ValEscape { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDeconstructValuePlaceholder(this);
public BoundDeconstructValuePlaceholder Update(uint valEscape, TypeSymbol type)
{
if (valEscape != this.ValEscape || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDeconstructValuePlaceholder(this.Syntax, valEscape, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundTupleOperandPlaceholder : BoundValuePlaceholderBase
{
public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.TupleOperandPlaceholder, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.TupleOperandPlaceholder, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTupleOperandPlaceholder(this);
public BoundTupleOperandPlaceholder Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTupleOperandPlaceholder(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundAwaitableValuePlaceholder : BoundValuePlaceholderBase
{
public BoundAwaitableValuePlaceholder(SyntaxNode syntax, uint valEscape, TypeSymbol? type, bool hasErrors)
: base(BoundKind.AwaitableValuePlaceholder, syntax, type, hasErrors)
{
this.ValEscape = valEscape;
}
public BoundAwaitableValuePlaceholder(SyntaxNode syntax, uint valEscape, TypeSymbol? type)
: base(BoundKind.AwaitableValuePlaceholder, syntax, type)
{
this.ValEscape = valEscape;
}
public new TypeSymbol? Type => base.Type!;
public uint ValEscape { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitAwaitableValuePlaceholder(this);
public BoundAwaitableValuePlaceholder Update(uint valEscape, TypeSymbol? type)
{
if (valEscape != this.ValEscape || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAwaitableValuePlaceholder(this.Syntax, valEscape, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDisposableValuePlaceholder : BoundValuePlaceholderBase
{
public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.DisposableValuePlaceholder, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.DisposableValuePlaceholder, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDisposableValuePlaceholder(this);
public BoundDisposableValuePlaceholder Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDisposableValuePlaceholder(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundObjectOrCollectionValuePlaceholder : BoundValuePlaceholderBase
{
public BoundObjectOrCollectionValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ObjectOrCollectionValuePlaceholder, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundObjectOrCollectionValuePlaceholder(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ObjectOrCollectionValuePlaceholder, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitObjectOrCollectionValuePlaceholder(this);
public BoundObjectOrCollectionValuePlaceholder Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundObjectOrCollectionValuePlaceholder(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDup : BoundExpression
{
public BoundDup(SyntaxNode syntax, RefKind refKind, TypeSymbol? type, bool hasErrors)
: base(BoundKind.Dup, syntax, type, hasErrors)
{
this.RefKind = refKind;
}
public BoundDup(SyntaxNode syntax, RefKind refKind, TypeSymbol? type)
: base(BoundKind.Dup, syntax, type)
{
this.RefKind = refKind;
}
public RefKind RefKind { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDup(this);
public BoundDup Update(RefKind refKind, TypeSymbol? type)
{
if (refKind != this.RefKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDup(this.Syntax, refKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundPassByCopy : BoundExpression
{
public BoundPassByCopy(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.PassByCopy, syntax, type, hasErrors || expression.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitPassByCopy(this);
public BoundPassByCopy Update(BoundExpression expression, TypeSymbol? type)
{
if (expression != this.Expression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundPassByCopy(this.Syntax, expression, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundBadExpression : BoundExpression
{
public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray symbols, ImmutableArray childBoundNodes, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.BadExpression, syntax, type, hasErrors || childBoundNodes.HasErrors())
{
Debug.Assert(!symbols.IsDefault, "Field 'symbols' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!childBoundNodes.IsDefault, "Field 'childBoundNodes' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this._ResultKind = resultKind;
this.Symbols = symbols;
this.ChildBoundNodes = childBoundNodes;
}
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public ImmutableArray Symbols { get; }
public ImmutableArray ChildBoundNodes { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitBadExpression(this);
public BoundBadExpression Update(LookupResultKind resultKind, ImmutableArray symbols, ImmutableArray childBoundNodes, TypeSymbol? type)
{
if (resultKind != this.ResultKind || symbols != this.Symbols || childBoundNodes != this.ChildBoundNodes || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundBadExpression(this.Syntax, resultKind, symbols, childBoundNodes, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundBadStatement : BoundStatement
{
public BoundBadStatement(SyntaxNode syntax, ImmutableArray childBoundNodes, bool hasErrors = false)
: base(BoundKind.BadStatement, syntax, hasErrors || childBoundNodes.HasErrors())
{
Debug.Assert(!childBoundNodes.IsDefault, "Field 'childBoundNodes' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ChildBoundNodes = childBoundNodes;
}
public ImmutableArray ChildBoundNodes { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitBadStatement(this);
public BoundBadStatement Update(ImmutableArray childBoundNodes)
{
if (childBoundNodes != this.ChildBoundNodes)
{
var result = new BoundBadStatement(this.Syntax, childBoundNodes, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundExtractedFinallyBlock : BoundStatement
{
public BoundExtractedFinallyBlock(SyntaxNode syntax, BoundBlock finallyBlock, bool hasErrors = false)
: base(BoundKind.ExtractedFinallyBlock, syntax, hasErrors || finallyBlock.HasErrors())
{
Debug.Assert(finallyBlock is object, "Field 'finallyBlock' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.FinallyBlock = finallyBlock;
}
public BoundBlock FinallyBlock { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitExtractedFinallyBlock(this);
public BoundExtractedFinallyBlock Update(BoundBlock finallyBlock)
{
if (finallyBlock != this.FinallyBlock)
{
var result = new BoundExtractedFinallyBlock(this.Syntax, finallyBlock, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundTypeExpression : BoundExpression
{
public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.TypeExpression, syntax, type, hasErrors || boundContainingTypeOpt.HasErrors() || boundDimensionsOpt.HasErrors())
{
this.AliasOpt = aliasOpt;
this.BoundContainingTypeOpt = boundContainingTypeOpt;
this.BoundDimensionsOpt = boundDimensionsOpt;
this.TypeWithAnnotations = typeWithAnnotations;
}
public AliasSymbol? AliasOpt { get; }
public BoundTypeExpression? BoundContainingTypeOpt { get; }
public ImmutableArray BoundDimensionsOpt { get; }
public TypeWithAnnotations TypeWithAnnotations { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTypeExpression(this);
public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol? type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(aliasOpt, this.AliasOpt) || boundContainingTypeOpt != this.BoundContainingTypeOpt || boundDimensionsOpt != this.BoundDimensionsOpt || typeWithAnnotations != this.TypeWithAnnotations || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTypeExpression(this.Syntax, aliasOpt, boundContainingTypeOpt, boundDimensionsOpt, typeWithAnnotations, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundTypeOrValueExpression : BoundExpression
{
public BoundTypeOrValueExpression(SyntaxNode syntax, BoundTypeOrValueData data, TypeSymbol type, bool hasErrors)
: base(BoundKind.TypeOrValueExpression, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Data = data;
}
public BoundTypeOrValueExpression(SyntaxNode syntax, BoundTypeOrValueData data, TypeSymbol type)
: base(BoundKind.TypeOrValueExpression, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Data = data;
}
public new TypeSymbol Type => base.Type!;
public BoundTypeOrValueData Data { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTypeOrValueExpression(this);
public BoundTypeOrValueExpression Update(BoundTypeOrValueData data, TypeSymbol type)
{
if (data != this.Data || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTypeOrValueExpression(this.Syntax, data, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundNamespaceExpression : BoundExpression
{
public BoundNamespaceExpression(SyntaxNode syntax, NamespaceSymbol namespaceSymbol, AliasSymbol? aliasOpt, bool hasErrors)
: base(BoundKind.NamespaceExpression, syntax, null, hasErrors)
{
Debug.Assert(namespaceSymbol is object, "Field 'namespaceSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.NamespaceSymbol = namespaceSymbol;
this.AliasOpt = aliasOpt;
}
public BoundNamespaceExpression(SyntaxNode syntax, NamespaceSymbol namespaceSymbol, AliasSymbol? aliasOpt)
: base(BoundKind.NamespaceExpression, syntax, null)
{
Debug.Assert(namespaceSymbol is object, "Field 'namespaceSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.NamespaceSymbol = namespaceSymbol;
this.AliasOpt = aliasOpt;
}
public new TypeSymbol Type => base.Type!;
public NamespaceSymbol NamespaceSymbol { get; }
public AliasSymbol? AliasOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitNamespaceExpression(this);
public BoundNamespaceExpression Update(NamespaceSymbol namespaceSymbol, AliasSymbol? aliasOpt)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(namespaceSymbol, this.NamespaceSymbol) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(aliasOpt, this.AliasOpt))
{
var result = new BoundNamespaceExpression(this.Syntax, namespaceSymbol, aliasOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundUnaryOperator : BoundExpression
{
public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.UnaryOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.OperatorKind = operatorKind;
this.Operand = operand;
this.ConstantValueOpt = constantValueOpt;
this.MethodOpt = methodOpt;
this._ResultKind = resultKind;
this.OriginalUserDefinedOperatorsOpt = originalUserDefinedOperatorsOpt;
}
public new TypeSymbol Type => base.Type!;
public UnaryOperatorKind OperatorKind { get; }
public BoundExpression Operand { get; }
public ConstantValue? ConstantValueOpt { get; }
public MethodSymbol? MethodOpt { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public ImmutableArray OriginalUserDefinedOperatorsOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitUnaryOperator(this);
public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || operand != this.Operand || constantValueOpt != this.ConstantValueOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundUnaryOperator(this.Syntax, operatorKind, operand, constantValueOpt, methodOpt, resultKind, originalUserDefinedOperatorsOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundIncrementOperator : BoundExpression
{
public BoundIncrementOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, Conversion operandConversion, Conversion resultConversion, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.IncrementOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.OperatorKind = operatorKind;
this.Operand = operand;
this.MethodOpt = methodOpt;
this.OperandConversion = operandConversion;
this.ResultConversion = resultConversion;
this._ResultKind = resultKind;
this.OriginalUserDefinedOperatorsOpt = originalUserDefinedOperatorsOpt;
}
public new TypeSymbol Type => base.Type!;
public UnaryOperatorKind OperatorKind { get; }
public BoundExpression Operand { get; }
public MethodSymbol? MethodOpt { get; }
public Conversion OperandConversion { get; }
public Conversion ResultConversion { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public ImmutableArray OriginalUserDefinedOperatorsOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitIncrementOperator(this);
public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, Conversion operandConversion, Conversion resultConversion, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || operandConversion != this.OperandConversion || resultConversion != this.ResultConversion || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundIncrementOperator(this.Syntax, operatorKind, operand, methodOpt, operandConversion, resultConversion, resultKind, originalUserDefinedOperatorsOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundAddressOfOperator : BoundExpression
{
public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, bool isManaged, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.AddressOfOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.IsManaged = isManaged;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
public bool IsManaged { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitAddressOfOperator(this);
public BoundAddressOfOperator Update(BoundExpression operand, bool isManaged, TypeSymbol type)
{
if (operand != this.Operand || isManaged != this.IsManaged || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAddressOfOperator(this.Syntax, operand, isManaged, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundPointerIndirectionOperator : BoundExpression
{
public BoundPointerIndirectionOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.PointerIndirectionOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitPointerIndirectionOperator(this);
public BoundPointerIndirectionOperator Update(BoundExpression operand, TypeSymbol type)
{
if (operand != this.Operand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundPointerIndirectionOperator(this.Syntax, operand, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundPointerElementAccess : BoundExpression
{
public BoundPointerElementAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression index, bool @checked, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.PointerElementAccess, syntax, type, hasErrors || expression.HasErrors() || index.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(index is object, "Field 'index' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.Index = index;
this.Checked = @checked;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Expression { get; }
public BoundExpression Index { get; }
public bool Checked { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitPointerElementAccess(this);
public BoundPointerElementAccess Update(BoundExpression expression, BoundExpression index, bool @checked, TypeSymbol type)
{
if (expression != this.Expression || index != this.Index || @checked != this.Checked || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundPointerElementAccess(this.Syntax, expression, index, @checked, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundRefTypeOperator : BoundExpression
{
public BoundRefTypeOperator(SyntaxNode syntax, BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.RefTypeOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.GetTypeFromHandle = getTypeFromHandle;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
public MethodSymbol? GetTypeFromHandle { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitRefTypeOperator(this);
public BoundRefTypeOperator Update(BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type)
{
if (operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getTypeFromHandle, this.GetTypeFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundRefTypeOperator(this.Syntax, operand, getTypeFromHandle, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundMakeRefOperator : BoundExpression
{
public BoundMakeRefOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.MakeRefOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitMakeRefOperator(this);
public BoundMakeRefOperator Update(BoundExpression operand, TypeSymbol type)
{
if (operand != this.Operand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundMakeRefOperator(this.Syntax, operand, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundRefValueOperator : BoundExpression
{
public BoundRefValueOperator(SyntaxNode syntax, NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.RefValueOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.NullableAnnotation = nullableAnnotation;
this.Operand = operand;
}
public new TypeSymbol Type => base.Type!;
public NullableAnnotation NullableAnnotation { get; }
public BoundExpression Operand { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitRefValueOperator(this);
public BoundRefValueOperator Update(NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type)
{
if (nullableAnnotation != this.NullableAnnotation || operand != this.Operand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundRefValueOperator(this.Syntax, nullableAnnotation, operand, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundFromEndIndexExpression : BoundExpression
{
public BoundFromEndIndexExpression(SyntaxNode syntax, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.FromEndIndexExpression, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.MethodOpt = methodOpt;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
public MethodSymbol? MethodOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitFromEndIndexExpression(this);
public BoundFromEndIndexExpression Update(BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type)
{
if (operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundFromEndIndexExpression(this.Syntax, operand, methodOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundRangeExpression : BoundExpression
{
public BoundRangeExpression(SyntaxNode syntax, BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.RangeExpression, syntax, type, hasErrors || leftOperandOpt.HasErrors() || rightOperandOpt.HasErrors())
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LeftOperandOpt = leftOperandOpt;
this.RightOperandOpt = rightOperandOpt;
this.MethodOpt = methodOpt;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression? LeftOperandOpt { get; }
public BoundExpression? RightOperandOpt { get; }
public MethodSymbol? MethodOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitRangeExpression(this);
public BoundRangeExpression Update(BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type)
{
if (leftOperandOpt != this.LeftOperandOpt || rightOperandOpt != this.RightOperandOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundRangeExpression(this.Syntax, leftOperandOpt, rightOperandOpt, methodOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundBinaryOperatorBase : BoundExpression
{
protected BoundBinaryOperatorBase(BoundKind kind, SyntaxNode syntax, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert(left is object, "Field 'left' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(right is object, "Field 'right' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Left = left;
this.Right = right;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Left { get; }
public BoundExpression Right { get; }
}
internal sealed partial class BoundBinaryOperator : BoundBinaryOperatorBase
{
public BoundBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.BinaryOperator, syntax, left, right, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert(left is object, "Field 'left' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(right is object, "Field 'right' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.OperatorKind = operatorKind;
this.ConstantValueOpt = constantValueOpt;
this.MethodOpt = methodOpt;
this._ResultKind = resultKind;
this.OriginalUserDefinedOperatorsOpt = originalUserDefinedOperatorsOpt;
}
public BinaryOperatorKind OperatorKind { get; }
public ConstantValue? ConstantValueOpt { get; }
public MethodSymbol? MethodOpt { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public ImmutableArray OriginalUserDefinedOperatorsOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitBinaryOperator(this);
public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || constantValueOpt != this.ConstantValueOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(methodOpt, this.MethodOpt) || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundBinaryOperator(this.Syntax, operatorKind, constantValueOpt, methodOpt, resultKind, originalUserDefinedOperatorsOpt, left, right, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundTupleBinaryOperator : BoundExpression
{
public BoundTupleBinaryOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.TupleBinaryOperator, syntax, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert(left is object, "Field 'left' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(right is object, "Field 'right' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(operators is object, "Field 'operators' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Left = left;
this.Right = right;
this.OperatorKind = operatorKind;
this.Operators = operators;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Left { get; }
public BoundExpression Right { get; }
public BinaryOperatorKind OperatorKind { get; }
public TupleBinaryOperatorInfo.Multiple Operators { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTupleBinaryOperator(this);
public BoundTupleBinaryOperator Update(BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type)
{
if (left != this.Left || right != this.Right || operatorKind != this.OperatorKind || operators != this.Operators || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTupleBinaryOperator(this.Syntax, left, right, operatorKind, operators, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundUserDefinedConditionalLogicalOperator : BoundBinaryOperatorBase
{
public BoundUserDefinedConditionalLogicalOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.UserDefinedConditionalLogicalOperator, syntax, left, right, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert(logicalOperator is object, "Field 'logicalOperator' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(trueOperator is object, "Field 'trueOperator' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(falseOperator is object, "Field 'falseOperator' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(left is object, "Field 'left' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(right is object, "Field 'right' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.OperatorKind = operatorKind;
this.LogicalOperator = logicalOperator;
this.TrueOperator = trueOperator;
this.FalseOperator = falseOperator;
this._ResultKind = resultKind;
this.OriginalUserDefinedOperatorsOpt = originalUserDefinedOperatorsOpt;
}
public BinaryOperatorKind OperatorKind { get; }
public MethodSymbol LogicalOperator { get; }
public MethodSymbol TrueOperator { get; }
public MethodSymbol FalseOperator { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public ImmutableArray OriginalUserDefinedOperatorsOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitUserDefinedConditionalLogicalOperator(this);
public BoundUserDefinedConditionalLogicalOperator Update(BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(logicalOperator, this.LogicalOperator) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(trueOperator, this.TrueOperator) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(falseOperator, this.FalseOperator) || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundUserDefinedConditionalLogicalOperator(this.Syntax, operatorKind, logicalOperator, trueOperator, falseOperator, resultKind, originalUserDefinedOperatorsOpt, left, right, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundCompoundAssignmentOperator : BoundExpression
{
public BoundCompoundAssignmentOperator(SyntaxNode syntax, BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, Conversion leftConversion, Conversion finalConversion, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.CompoundAssignmentOperator, syntax, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert(left is object, "Field 'left' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(right is object, "Field 'right' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operator = @operator;
this.Left = left;
this.Right = right;
this.LeftConversion = leftConversion;
this.FinalConversion = finalConversion;
this._ResultKind = resultKind;
this.OriginalUserDefinedOperatorsOpt = originalUserDefinedOperatorsOpt;
}
public new TypeSymbol Type => base.Type!;
public BinaryOperatorSignature Operator { get; }
public BoundExpression Left { get; }
public BoundExpression Right { get; }
public Conversion LeftConversion { get; }
public Conversion FinalConversion { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public ImmutableArray OriginalUserDefinedOperatorsOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitCompoundAssignmentOperator(this);
public BoundCompoundAssignmentOperator Update(BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, Conversion leftConversion, Conversion finalConversion, LookupResultKind resultKind, ImmutableArray originalUserDefinedOperatorsOpt, TypeSymbol type)
{
if (@operator != this.Operator || left != this.Left || right != this.Right || leftConversion != this.LeftConversion || finalConversion != this.FinalConversion || resultKind != this.ResultKind || originalUserDefinedOperatorsOpt != this.OriginalUserDefinedOperatorsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundCompoundAssignmentOperator(this.Syntax, @operator, left, right, leftConversion, finalConversion, resultKind, originalUserDefinedOperatorsOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundAssignmentOperator : BoundExpression
{
public BoundAssignmentOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, bool isRef, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.AssignmentOperator, syntax, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert(left is object, "Field 'left' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Left = left;
this.Right = right;
this.IsRef = isRef;
}
public BoundExpression Left { get; }
public BoundExpression Right { get; }
public bool IsRef { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitAssignmentOperator(this);
public BoundAssignmentOperator Update(BoundExpression left, BoundExpression right, bool isRef, TypeSymbol? type)
{
if (left != this.Left || right != this.Right || isRef != this.IsRef || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAssignmentOperator(this.Syntax, left, right, isRef, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDeconstructionAssignmentOperator : BoundExpression
{
public BoundDeconstructionAssignmentOperator(SyntaxNode syntax, BoundTupleExpression left, BoundConversion right, bool isUsed, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.DeconstructionAssignmentOperator, syntax, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert(left is object, "Field 'left' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(right is object, "Field 'right' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Left = left;
this.Right = right;
this.IsUsed = isUsed;
}
public new TypeSymbol Type => base.Type!;
public BoundTupleExpression Left { get; }
public BoundConversion Right { get; }
public bool IsUsed { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDeconstructionAssignmentOperator(this);
public BoundDeconstructionAssignmentOperator Update(BoundTupleExpression left, BoundConversion right, bool isUsed, TypeSymbol type)
{
if (left != this.Left || right != this.Right || isUsed != this.IsUsed || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDeconstructionAssignmentOperator(this.Syntax, left, right, isUsed, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundNullCoalescingOperator : BoundExpression
{
public BoundNullCoalescingOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, Conversion leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.NullCoalescingOperator, syntax, type, hasErrors || leftOperand.HasErrors() || rightOperand.HasErrors())
{
Debug.Assert(leftOperand is object, "Field 'leftOperand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(rightOperand is object, "Field 'rightOperand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LeftOperand = leftOperand;
this.RightOperand = rightOperand;
this.LeftConversion = leftConversion;
this.OperatorResultKind = operatorResultKind;
}
public BoundExpression LeftOperand { get; }
public BoundExpression RightOperand { get; }
public Conversion LeftConversion { get; }
public BoundNullCoalescingOperatorResultKind OperatorResultKind { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitNullCoalescingOperator(this);
public BoundNullCoalescingOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, Conversion leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, TypeSymbol? type)
{
if (leftOperand != this.LeftOperand || rightOperand != this.RightOperand || leftConversion != this.LeftConversion || operatorResultKind != this.OperatorResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundNullCoalescingOperator(this.Syntax, leftOperand, rightOperand, leftConversion, operatorResultKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundNullCoalescingAssignmentOperator : BoundExpression
{
public BoundNullCoalescingAssignmentOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.NullCoalescingAssignmentOperator, syntax, type, hasErrors || leftOperand.HasErrors() || rightOperand.HasErrors())
{
Debug.Assert(leftOperand is object, "Field 'leftOperand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(rightOperand is object, "Field 'rightOperand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LeftOperand = leftOperand;
this.RightOperand = rightOperand;
}
public BoundExpression LeftOperand { get; }
public BoundExpression RightOperand { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitNullCoalescingAssignmentOperator(this);
public BoundNullCoalescingAssignmentOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type)
{
if (leftOperand != this.LeftOperand || rightOperand != this.RightOperand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundNullCoalescingAssignmentOperator(this.Syntax, leftOperand, rightOperand, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundConditionalOperator : BoundExpression
{
public BoundConditionalOperator(SyntaxNode syntax, bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ConditionalOperator, syntax, type, hasErrors || condition.HasErrors() || consequence.HasErrors() || alternative.HasErrors())
{
Debug.Assert(condition is object, "Field 'condition' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(consequence is object, "Field 'consequence' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(alternative is object, "Field 'alternative' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.IsRef = isRef;
this.Condition = condition;
this.Consequence = consequence;
this.Alternative = alternative;
this.ConstantValueOpt = constantValueOpt;
}
public new TypeSymbol Type => base.Type!;
public bool IsRef { get; }
public BoundExpression Condition { get; }
public BoundExpression Consequence { get; }
public BoundExpression Alternative { get; }
public ConstantValue? ConstantValueOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitConditionalOperator(this);
public BoundConditionalOperator Update(bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol type)
{
if (isRef != this.IsRef || condition != this.Condition || consequence != this.Consequence || alternative != this.Alternative || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConditionalOperator(this.Syntax, isRef, condition, consequence, alternative, constantValueOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundArrayAccess : BoundExpression
{
public BoundArrayAccess(SyntaxNode syntax, BoundExpression expression, ImmutableArray indices, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ArrayAccess, syntax, type, hasErrors || expression.HasErrors() || indices.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!indices.IsDefault, "Field 'indices' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.Indices = indices;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Expression { get; }
public ImmutableArray Indices { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitArrayAccess(this);
public BoundArrayAccess Update(BoundExpression expression, ImmutableArray indices, TypeSymbol type)
{
if (expression != this.Expression || indices != this.Indices || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundArrayAccess(this.Syntax, expression, indices, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundArrayLength : BoundExpression
{
public BoundArrayLength(SyntaxNode syntax, BoundExpression expression, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ArrayLength, syntax, type, hasErrors || expression.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Expression { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitArrayLength(this);
public BoundArrayLength Update(BoundExpression expression, TypeSymbol type)
{
if (expression != this.Expression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundArrayLength(this.Syntax, expression, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundAwaitableInfo : BoundNode
{
public BoundAwaitableInfo(SyntaxNode syntax, BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, bool hasErrors = false)
: base(BoundKind.AwaitableInfo, syntax, hasErrors || awaitableInstancePlaceholder.HasErrors() || getAwaiter.HasErrors())
{
this.AwaitableInstancePlaceholder = awaitableInstancePlaceholder;
this.IsDynamic = isDynamic;
this.GetAwaiter = getAwaiter;
this.IsCompleted = isCompleted;
this.GetResult = getResult;
}
public BoundAwaitableValuePlaceholder? AwaitableInstancePlaceholder { get; }
public bool IsDynamic { get; }
public BoundExpression? GetAwaiter { get; }
public PropertySymbol? IsCompleted { get; }
public MethodSymbol? GetResult { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitAwaitableInfo(this);
public BoundAwaitableInfo Update(BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult)
{
if (awaitableInstancePlaceholder != this.AwaitableInstancePlaceholder || isDynamic != this.IsDynamic || getAwaiter != this.GetAwaiter || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(isCompleted, this.IsCompleted) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getResult, this.GetResult))
{
var result = new BoundAwaitableInfo(this.Syntax, awaitableInstancePlaceholder, isDynamic, getAwaiter, isCompleted, getResult, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundAwaitExpression : BoundExpression
{
public BoundAwaitExpression(SyntaxNode syntax, BoundExpression expression, BoundAwaitableInfo awaitableInfo, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.AwaitExpression, syntax, type, hasErrors || expression.HasErrors() || awaitableInfo.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(awaitableInfo is object, "Field 'awaitableInfo' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.AwaitableInfo = awaitableInfo;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Expression { get; }
public BoundAwaitableInfo AwaitableInfo { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitAwaitExpression(this);
public BoundAwaitExpression Update(BoundExpression expression, BoundAwaitableInfo awaitableInfo, TypeSymbol type)
{
if (expression != this.Expression || awaitableInfo != this.AwaitableInfo || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAwaitExpression(this.Syntax, expression, awaitableInfo, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundTypeOf : BoundExpression
{
protected BoundTypeOf(BoundKind kind, SyntaxNode syntax, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.GetTypeFromHandle = getTypeFromHandle;
}
protected BoundTypeOf(BoundKind kind, SyntaxNode syntax, MethodSymbol? getTypeFromHandle, TypeSymbol type)
: base(kind, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.GetTypeFromHandle = getTypeFromHandle;
}
public new TypeSymbol Type => base.Type!;
public MethodSymbol? GetTypeFromHandle { get; }
}
internal sealed partial class BoundTypeOfOperator : BoundTypeOf
{
public BoundTypeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.TypeOfOperator, syntax, getTypeFromHandle, type, hasErrors || sourceType.HasErrors())
{
Debug.Assert(sourceType is object, "Field 'sourceType' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.SourceType = sourceType;
}
public BoundTypeExpression SourceType { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTypeOfOperator(this);
public BoundTypeOfOperator Update(BoundTypeExpression sourceType, MethodSymbol? getTypeFromHandle, TypeSymbol type)
{
if (sourceType != this.SourceType || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getTypeFromHandle, this.GetTypeFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTypeOfOperator(this.Syntax, sourceType, getTypeFromHandle, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundMethodDefIndex : BoundExpression
{
public BoundMethodDefIndex(SyntaxNode syntax, MethodSymbol method, TypeSymbol type, bool hasErrors)
: base(BoundKind.MethodDefIndex, syntax, type, hasErrors)
{
Debug.Assert(method is object, "Field 'method' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Method = method;
}
public BoundMethodDefIndex(SyntaxNode syntax, MethodSymbol method, TypeSymbol type)
: base(BoundKind.MethodDefIndex, syntax, type)
{
Debug.Assert(method is object, "Field 'method' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Method = method;
}
public new TypeSymbol Type => base.Type!;
public MethodSymbol Method { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitMethodDefIndex(this);
public BoundMethodDefIndex Update(MethodSymbol method, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(method, this.Method) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundMethodDefIndex(this.Syntax, method, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundMaximumMethodDefIndex : BoundExpression
{
public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.MaximumMethodDefIndex, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.MaximumMethodDefIndex, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitMaximumMethodDefIndex(this);
public BoundMaximumMethodDefIndex Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundMaximumMethodDefIndex(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundInstrumentationPayloadRoot : BoundExpression
{
public BoundInstrumentationPayloadRoot(SyntaxNode syntax, int analysisKind, TypeSymbol type, bool hasErrors)
: base(BoundKind.InstrumentationPayloadRoot, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.AnalysisKind = analysisKind;
}
public BoundInstrumentationPayloadRoot(SyntaxNode syntax, int analysisKind, TypeSymbol type)
: base(BoundKind.InstrumentationPayloadRoot, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.AnalysisKind = analysisKind;
}
public int AnalysisKind { get; }
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitInstrumentationPayloadRoot(this);
public BoundInstrumentationPayloadRoot Update(int analysisKind, TypeSymbol type)
{
if (analysisKind != this.AnalysisKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundInstrumentationPayloadRoot(this.Syntax, analysisKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundModuleVersionId : BoundExpression
{
public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ModuleVersionId, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ModuleVersionId, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitModuleVersionId(this);
public BoundModuleVersionId Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundModuleVersionId(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundModuleVersionIdString : BoundExpression
{
public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ModuleVersionIdString, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ModuleVersionIdString, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitModuleVersionIdString(this);
public BoundModuleVersionIdString Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundModuleVersionIdString(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSourceDocumentIndex : BoundExpression
{
public BoundSourceDocumentIndex(SyntaxNode syntax, Cci.DebugSourceDocument document, TypeSymbol type, bool hasErrors)
: base(BoundKind.SourceDocumentIndex, syntax, type, hasErrors)
{
Debug.Assert(document is object, "Field 'document' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Document = document;
}
public BoundSourceDocumentIndex(SyntaxNode syntax, Cci.DebugSourceDocument document, TypeSymbol type)
: base(BoundKind.SourceDocumentIndex, syntax, type)
{
Debug.Assert(document is object, "Field 'document' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Document = document;
}
public new TypeSymbol Type => base.Type!;
public Cci.DebugSourceDocument Document { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSourceDocumentIndex(this);
public BoundSourceDocumentIndex Update(Cci.DebugSourceDocument document, TypeSymbol type)
{
if (document != this.Document || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundSourceDocumentIndex(this.Syntax, document, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundMethodInfo : BoundExpression
{
public BoundMethodInfo(SyntaxNode syntax, MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type, bool hasErrors)
: base(BoundKind.MethodInfo, syntax, type, hasErrors)
{
Debug.Assert(method is object, "Field 'method' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Method = method;
this.GetMethodFromHandle = getMethodFromHandle;
}
public BoundMethodInfo(SyntaxNode syntax, MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type)
: base(BoundKind.MethodInfo, syntax, type)
{
Debug.Assert(method is object, "Field 'method' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Method = method;
this.GetMethodFromHandle = getMethodFromHandle;
}
public new TypeSymbol Type => base.Type!;
public MethodSymbol Method { get; }
public MethodSymbol? GetMethodFromHandle { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitMethodInfo(this);
public BoundMethodInfo Update(MethodSymbol method, MethodSymbol? getMethodFromHandle, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(method, this.Method) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getMethodFromHandle, this.GetMethodFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundMethodInfo(this.Syntax, method, getMethodFromHandle, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundFieldInfo : BoundExpression
{
public BoundFieldInfo(SyntaxNode syntax, FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type, bool hasErrors)
: base(BoundKind.FieldInfo, syntax, type, hasErrors)
{
Debug.Assert(field is object, "Field 'field' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Field = field;
this.GetFieldFromHandle = getFieldFromHandle;
}
public BoundFieldInfo(SyntaxNode syntax, FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type)
: base(BoundKind.FieldInfo, syntax, type)
{
Debug.Assert(field is object, "Field 'field' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Field = field;
this.GetFieldFromHandle = getFieldFromHandle;
}
public new TypeSymbol Type => base.Type!;
public FieldSymbol Field { get; }
public MethodSymbol? GetFieldFromHandle { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitFieldInfo(this);
public BoundFieldInfo Update(FieldSymbol field, MethodSymbol? getFieldFromHandle, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(field, this.Field) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getFieldFromHandle, this.GetFieldFromHandle) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundFieldInfo(this.Syntax, field, getFieldFromHandle, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDefaultLiteral : BoundExpression
{
public BoundDefaultLiteral(SyntaxNode syntax, bool hasErrors)
: base(BoundKind.DefaultLiteral, syntax, null, hasErrors)
{
}
public BoundDefaultLiteral(SyntaxNode syntax)
: base(BoundKind.DefaultLiteral, syntax, null)
{
}
public new TypeSymbol? Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDefaultLiteral(this);
public BoundDefaultLiteral Update()
{
return this;
}
}
internal sealed partial class BoundDefaultExpression : BoundExpression
{
public BoundDefaultExpression(SyntaxNode syntax, BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.DefaultExpression, syntax, type, hasErrors || targetType.HasErrors())
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.TargetType = targetType;
this.ConstantValueOpt = constantValueOpt;
}
public new TypeSymbol Type => base.Type!;
public BoundTypeExpression? TargetType { get; }
public ConstantValue? ConstantValueOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDefaultExpression(this);
public BoundDefaultExpression Update(BoundTypeExpression? targetType, ConstantValue? constantValueOpt, TypeSymbol type)
{
if (targetType != this.TargetType || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDefaultExpression(this.Syntax, targetType, constantValueOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundIsOperator : BoundExpression
{
public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, Conversion conversion, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.IsOperator, syntax, type, hasErrors || operand.HasErrors() || targetType.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(targetType is object, "Field 'targetType' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.TargetType = targetType;
this.Conversion = conversion;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
public BoundTypeExpression TargetType { get; }
public Conversion Conversion { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitIsOperator(this);
public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, Conversion conversion, TypeSymbol type)
{
if (operand != this.Operand || targetType != this.TargetType || conversion != this.Conversion || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundIsOperator(this.Syntax, operand, targetType, conversion, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundAsOperator : BoundExpression
{
public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, Conversion conversion, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.AsOperator, syntax, type, hasErrors || operand.HasErrors() || targetType.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(targetType is object, "Field 'targetType' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.TargetType = targetType;
this.Conversion = conversion;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
public BoundTypeExpression TargetType { get; }
public Conversion Conversion { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitAsOperator(this);
public BoundAsOperator Update(BoundExpression operand, BoundTypeExpression targetType, Conversion conversion, TypeSymbol type)
{
if (operand != this.Operand || targetType != this.TargetType || conversion != this.Conversion || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAsOperator(this.Syntax, operand, targetType, conversion, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSizeOfOperator : BoundExpression
{
public BoundSizeOfOperator(SyntaxNode syntax, BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.SizeOfOperator, syntax, type, hasErrors || sourceType.HasErrors())
{
Debug.Assert(sourceType is object, "Field 'sourceType' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.SourceType = sourceType;
this.ConstantValueOpt = constantValueOpt;
}
public new TypeSymbol Type => base.Type!;
public BoundTypeExpression SourceType { get; }
public ConstantValue? ConstantValueOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSizeOfOperator(this);
public BoundSizeOfOperator Update(BoundTypeExpression sourceType, ConstantValue? constantValueOpt, TypeSymbol type)
{
if (sourceType != this.SourceType || constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundSizeOfOperator(this.Syntax, sourceType, constantValueOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundConversion : BoundExpression
{
public BoundConversion(SyntaxNode syntax, BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, ImmutableArray originalUserDefinedConversionsOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.Conversion, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.Conversion = conversion;
this.IsBaseConversion = isBaseConversion;
this.Checked = @checked;
this.ExplicitCastInCode = explicitCastInCode;
this.ConstantValueOpt = constantValueOpt;
this.ConversionGroupOpt = conversionGroupOpt;
this.OriginalUserDefinedConversionsOpt = originalUserDefinedConversionsOpt;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
public Conversion Conversion { get; }
public bool IsBaseConversion { get; }
public bool Checked { get; }
public bool ExplicitCastInCode { get; }
public ConstantValue? ConstantValueOpt { get; }
public ConversionGroup? ConversionGroupOpt { get; }
public ImmutableArray OriginalUserDefinedConversionsOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitConversion(this);
public BoundConversion Update(BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, ImmutableArray originalUserDefinedConversionsOpt, TypeSymbol type)
{
if (operand != this.Operand || conversion != this.Conversion || isBaseConversion != this.IsBaseConversion || @checked != this.Checked || explicitCastInCode != this.ExplicitCastInCode || constantValueOpt != this.ConstantValueOpt || conversionGroupOpt != this.ConversionGroupOpt || originalUserDefinedConversionsOpt != this.OriginalUserDefinedConversionsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConversion(this.Syntax, operand, conversion, isBaseConversion, @checked, explicitCastInCode, constantValueOpt, conversionGroupOpt, originalUserDefinedConversionsOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundReadOnlySpanFromArray : BoundExpression
{
public BoundReadOnlySpanFromArray(SyntaxNode syntax, BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ReadOnlySpanFromArray, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert(operand is object, "Field 'operand' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(conversionMethod is object, "Field 'conversionMethod' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.ConversionMethod = conversionMethod;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Operand { get; }
public MethodSymbol ConversionMethod { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitReadOnlySpanFromArray(this);
public BoundReadOnlySpanFromArray Update(BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type)
{
if (operand != this.Operand || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(conversionMethod, this.ConversionMethod) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundReadOnlySpanFromArray(this.Syntax, operand, conversionMethod, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundArgList : BoundExpression
{
public BoundArgList(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ArgList, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundArgList(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ArgList, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitArgList(this);
public BoundArgList Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundArgList(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundArgListOperator : BoundExpression
{
public BoundArgListOperator(SyntaxNode syntax, ImmutableArray arguments, ImmutableArray argumentRefKindsOpt, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.ArgListOperator, syntax, type, hasErrors || arguments.HasErrors())
{
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Arguments = arguments;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
}
public new TypeSymbol? Type => base.Type!;
public ImmutableArray Arguments { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitArgListOperator(this);
public BoundArgListOperator Update(ImmutableArray arguments, ImmutableArray argumentRefKindsOpt, TypeSymbol? type)
{
if (arguments != this.Arguments || argumentRefKindsOpt != this.ArgumentRefKindsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundArgListOperator(this.Syntax, arguments, argumentRefKindsOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundFixedLocalCollectionInitializer : BoundExpression
{
public BoundFixedLocalCollectionInitializer(SyntaxNode syntax, TypeSymbol elementPointerType, Conversion elementPointerTypeConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.FixedLocalCollectionInitializer, syntax, type, hasErrors || expression.HasErrors())
{
Debug.Assert(elementPointerType is object, "Field 'elementPointerType' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ElementPointerType = elementPointerType;
this.ElementPointerTypeConversion = elementPointerTypeConversion;
this.Expression = expression;
this.GetPinnableOpt = getPinnableOpt;
}
public new TypeSymbol Type => base.Type!;
public TypeSymbol ElementPointerType { get; }
public Conversion ElementPointerTypeConversion { get; }
public BoundExpression Expression { get; }
public MethodSymbol? GetPinnableOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitFixedLocalCollectionInitializer(this);
public BoundFixedLocalCollectionInitializer Update(TypeSymbol elementPointerType, Conversion elementPointerTypeConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type)
{
if (!TypeSymbol.Equals(elementPointerType, this.ElementPointerType, TypeCompareKind.ConsiderEverything) || elementPointerTypeConversion != this.ElementPointerTypeConversion || expression != this.Expression || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getPinnableOpt, this.GetPinnableOpt) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundFixedLocalCollectionInitializer(this.Syntax, elementPointerType, elementPointerTypeConversion, expression, getPinnableOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundStatement : BoundNode
{
protected BoundStatement(BoundKind kind, SyntaxNode syntax, bool hasErrors)
: base(kind, syntax, hasErrors)
{
}
protected BoundStatement(BoundKind kind, SyntaxNode syntax)
: base(kind, syntax)
{
}
}
internal sealed partial class BoundSequencePoint : BoundStatement
{
public BoundSequencePoint(SyntaxNode syntax, BoundStatement? statementOpt, bool hasErrors = false)
: base(BoundKind.SequencePoint, syntax, hasErrors || statementOpt.HasErrors())
{
this.StatementOpt = statementOpt;
}
public BoundStatement? StatementOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSequencePoint(this);
public BoundSequencePoint Update(BoundStatement? statementOpt)
{
if (statementOpt != this.StatementOpt)
{
var result = new BoundSequencePoint(this.Syntax, statementOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSequencePointWithSpan : BoundStatement
{
public BoundSequencePointWithSpan(SyntaxNode syntax, BoundStatement? statementOpt, TextSpan span, bool hasErrors = false)
: base(BoundKind.SequencePointWithSpan, syntax, hasErrors || statementOpt.HasErrors())
{
this.StatementOpt = statementOpt;
this.Span = span;
}
public BoundStatement? StatementOpt { get; }
public TextSpan Span { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSequencePointWithSpan(this);
public BoundSequencePointWithSpan Update(BoundStatement? statementOpt, TextSpan span)
{
if (statementOpt != this.StatementOpt || span != this.Span)
{
var result = new BoundSequencePointWithSpan(this.Syntax, statementOpt, span, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundBlock : BoundStatementList
{
public BoundBlock(SyntaxNode syntax, ImmutableArray locals, ImmutableArray localFunctions, ImmutableArray statements, bool hasErrors = false)
: base(BoundKind.Block, syntax, statements, hasErrors || statements.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!localFunctions.IsDefault, "Field 'localFunctions' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!statements.IsDefault, "Field 'statements' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.LocalFunctions = localFunctions;
}
public ImmutableArray Locals { get; }
public ImmutableArray LocalFunctions { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitBlock(this);
public BoundBlock Update(ImmutableArray locals, ImmutableArray localFunctions, ImmutableArray statements)
{
if (locals != this.Locals || localFunctions != this.LocalFunctions || statements != this.Statements)
{
var result = new BoundBlock(this.Syntax, locals, localFunctions, statements, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundScope : BoundStatementList
{
public BoundScope(SyntaxNode syntax, ImmutableArray locals, ImmutableArray statements, bool hasErrors = false)
: base(BoundKind.Scope, syntax, statements, hasErrors || statements.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!statements.IsDefault, "Field 'statements' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Locals = locals;
}
public ImmutableArray Locals { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitScope(this);
public BoundScope Update(ImmutableArray locals, ImmutableArray statements)
{
if (locals != this.Locals || statements != this.Statements)
{
var result = new BoundScope(this.Syntax, locals, statements, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundStateMachineScope : BoundStatement
{
public BoundStateMachineScope(SyntaxNode syntax, ImmutableArray fields, BoundStatement statement, bool hasErrors = false)
: base(BoundKind.StateMachineScope, syntax, hasErrors || statement.HasErrors())
{
Debug.Assert(!fields.IsDefault, "Field 'fields' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(statement is object, "Field 'statement' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Fields = fields;
this.Statement = statement;
}
public ImmutableArray Fields { get; }
public BoundStatement Statement { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitStateMachineScope(this);
public BoundStateMachineScope Update(ImmutableArray fields, BoundStatement statement)
{
if (fields != this.Fields || statement != this.Statement)
{
var result = new BoundStateMachineScope(this.Syntax, fields, statement, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLocalDeclaration : BoundStatement
{
public BoundLocalDeclaration(SyntaxNode syntax, LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray argumentsOpt, bool inferredType, bool hasErrors = false)
: base(BoundKind.LocalDeclaration, syntax, hasErrors || declaredTypeOpt.HasErrors() || initializerOpt.HasErrors() || argumentsOpt.HasErrors())
{
Debug.Assert(localSymbol is object, "Field 'localSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.DeclaredTypeOpt = declaredTypeOpt;
this.InitializerOpt = initializerOpt;
this.ArgumentsOpt = argumentsOpt;
this.InferredType = inferredType;
}
public LocalSymbol LocalSymbol { get; }
public BoundTypeExpression? DeclaredTypeOpt { get; }
public BoundExpression? InitializerOpt { get; }
public ImmutableArray ArgumentsOpt { get; }
public bool InferredType { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLocalDeclaration(this);
public BoundLocalDeclaration Update(LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray argumentsOpt, bool inferredType)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(localSymbol, this.LocalSymbol) || declaredTypeOpt != this.DeclaredTypeOpt || initializerOpt != this.InitializerOpt || argumentsOpt != this.ArgumentsOpt || inferredType != this.InferredType)
{
var result = new BoundLocalDeclaration(this.Syntax, localSymbol, declaredTypeOpt, initializerOpt, argumentsOpt, inferredType, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundMultipleLocalDeclarationsBase : BoundStatement
{
protected BoundMultipleLocalDeclarationsBase(BoundKind kind, SyntaxNode syntax, ImmutableArray localDeclarations, bool hasErrors = false)
: base(kind, syntax, hasErrors)
{
Debug.Assert(!localDeclarations.IsDefault, "Field 'localDeclarations' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.LocalDeclarations = localDeclarations;
}
public ImmutableArray LocalDeclarations { get; }
}
internal sealed partial class BoundMultipleLocalDeclarations : BoundMultipleLocalDeclarationsBase
{
public BoundMultipleLocalDeclarations(SyntaxNode syntax, ImmutableArray localDeclarations, bool hasErrors = false)
: base(BoundKind.MultipleLocalDeclarations, syntax, localDeclarations, hasErrors || localDeclarations.HasErrors())
{
Debug.Assert(!localDeclarations.IsDefault, "Field 'localDeclarations' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitMultipleLocalDeclarations(this);
public BoundMultipleLocalDeclarations Update(ImmutableArray localDeclarations)
{
if (localDeclarations != this.LocalDeclarations)
{
var result = new BoundMultipleLocalDeclarations(this.Syntax, localDeclarations, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundUsingLocalDeclarations : BoundMultipleLocalDeclarationsBase
{
public BoundUsingLocalDeclarations(SyntaxNode syntax, MethodSymbol? disposeMethodOpt, Conversion iDisposableConversion, BoundAwaitableInfo? awaitOpt, ImmutableArray localDeclarations, bool hasErrors = false)
: base(BoundKind.UsingLocalDeclarations, syntax, localDeclarations, hasErrors || awaitOpt.HasErrors() || localDeclarations.HasErrors())
{
Debug.Assert(!localDeclarations.IsDefault, "Field 'localDeclarations' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.DisposeMethodOpt = disposeMethodOpt;
this.IDisposableConversion = iDisposableConversion;
this.AwaitOpt = awaitOpt;
}
public MethodSymbol? DisposeMethodOpt { get; }
public Conversion IDisposableConversion { get; }
public BoundAwaitableInfo? AwaitOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitUsingLocalDeclarations(this);
public BoundUsingLocalDeclarations Update(MethodSymbol? disposeMethodOpt, Conversion iDisposableConversion, BoundAwaitableInfo? awaitOpt, ImmutableArray localDeclarations)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(disposeMethodOpt, this.DisposeMethodOpt) || iDisposableConversion != this.IDisposableConversion || awaitOpt != this.AwaitOpt || localDeclarations != this.LocalDeclarations)
{
var result = new BoundUsingLocalDeclarations(this.Syntax, disposeMethodOpt, iDisposableConversion, awaitOpt, localDeclarations, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLocalFunctionStatement : BoundStatement
{
public BoundLocalFunctionStatement(SyntaxNode syntax, LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody, bool hasErrors = false)
: base(BoundKind.LocalFunctionStatement, syntax, hasErrors || blockBody.HasErrors() || expressionBody.HasErrors())
{
Debug.Assert(symbol is object, "Field 'symbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Symbol = symbol;
this.BlockBody = blockBody;
this.ExpressionBody = expressionBody;
}
public LocalFunctionSymbol Symbol { get; }
public BoundBlock? BlockBody { get; }
public BoundBlock? ExpressionBody { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLocalFunctionStatement(this);
public BoundLocalFunctionStatement Update(LocalFunctionSymbol symbol, BoundBlock? blockBody, BoundBlock? expressionBody)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(symbol, this.Symbol) || blockBody != this.BlockBody || expressionBody != this.ExpressionBody)
{
var result = new BoundLocalFunctionStatement(this.Syntax, symbol, blockBody, expressionBody, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundNoOpStatement : BoundStatement
{
public BoundNoOpStatement(SyntaxNode syntax, NoOpStatementFlavor flavor, bool hasErrors)
: base(BoundKind.NoOpStatement, syntax, hasErrors)
{
this.Flavor = flavor;
}
public BoundNoOpStatement(SyntaxNode syntax, NoOpStatementFlavor flavor)
: base(BoundKind.NoOpStatement, syntax)
{
this.Flavor = flavor;
}
public NoOpStatementFlavor Flavor { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitNoOpStatement(this);
public BoundNoOpStatement Update(NoOpStatementFlavor flavor)
{
if (flavor != this.Flavor)
{
var result = new BoundNoOpStatement(this.Syntax, flavor, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundReturnStatement : BoundStatement
{
public BoundReturnStatement(SyntaxNode syntax, RefKind refKind, BoundExpression? expressionOpt, bool hasErrors = false)
: base(BoundKind.ReturnStatement, syntax, hasErrors || expressionOpt.HasErrors())
{
this.RefKind = refKind;
this.ExpressionOpt = expressionOpt;
}
public RefKind RefKind { get; }
public BoundExpression? ExpressionOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitReturnStatement(this);
public BoundReturnStatement Update(RefKind refKind, BoundExpression? expressionOpt)
{
if (refKind != this.RefKind || expressionOpt != this.ExpressionOpt)
{
var result = new BoundReturnStatement(this.Syntax, refKind, expressionOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundYieldReturnStatement : BoundStatement
{
public BoundYieldReturnStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false)
: base(BoundKind.YieldReturnStatement, syntax, hasErrors || expression.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitYieldReturnStatement(this);
public BoundYieldReturnStatement Update(BoundExpression expression)
{
if (expression != this.Expression)
{
var result = new BoundYieldReturnStatement(this.Syntax, expression, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundYieldBreakStatement : BoundStatement
{
public BoundYieldBreakStatement(SyntaxNode syntax, bool hasErrors)
: base(BoundKind.YieldBreakStatement, syntax, hasErrors)
{
}
public BoundYieldBreakStatement(SyntaxNode syntax)
: base(BoundKind.YieldBreakStatement, syntax)
{
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitYieldBreakStatement(this);
}
internal sealed partial class BoundThrowStatement : BoundStatement
{
public BoundThrowStatement(SyntaxNode syntax, BoundExpression? expressionOpt, bool hasErrors = false)
: base(BoundKind.ThrowStatement, syntax, hasErrors || expressionOpt.HasErrors())
{
this.ExpressionOpt = expressionOpt;
}
public BoundExpression? ExpressionOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitThrowStatement(this);
public BoundThrowStatement Update(BoundExpression? expressionOpt)
{
if (expressionOpt != this.ExpressionOpt)
{
var result = new BoundThrowStatement(this.Syntax, expressionOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundExpressionStatement : BoundStatement
{
public BoundExpressionStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false)
: base(BoundKind.ExpressionStatement, syntax, hasErrors || expression.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitExpressionStatement(this);
public BoundExpressionStatement Update(BoundExpression expression)
{
if (expression != this.Expression)
{
var result = new BoundExpressionStatement(this.Syntax, expression, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundBreakStatement : BoundStatement
{
public BoundBreakStatement(SyntaxNode syntax, GeneratedLabelSymbol label, bool hasErrors)
: base(BoundKind.BreakStatement, syntax, hasErrors)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundBreakStatement(SyntaxNode syntax, GeneratedLabelSymbol label)
: base(BoundKind.BreakStatement, syntax)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public GeneratedLabelSymbol Label { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitBreakStatement(this);
public BoundBreakStatement Update(GeneratedLabelSymbol label)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label))
{
var result = new BoundBreakStatement(this.Syntax, label, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundContinueStatement : BoundStatement
{
public BoundContinueStatement(SyntaxNode syntax, GeneratedLabelSymbol label, bool hasErrors)
: base(BoundKind.ContinueStatement, syntax, hasErrors)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundContinueStatement(SyntaxNode syntax, GeneratedLabelSymbol label)
: base(BoundKind.ContinueStatement, syntax)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public GeneratedLabelSymbol Label { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitContinueStatement(this);
public BoundContinueStatement Update(GeneratedLabelSymbol label)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label))
{
var result = new BoundContinueStatement(this.Syntax, label, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSwitchStatement : BoundStatement
{
public BoundSwitchStatement(SyntaxNode syntax, BoundExpression expression, ImmutableArray innerLocals, ImmutableArray innerLocalFunctions, ImmutableArray switchSections, BoundDecisionDag decisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel, bool hasErrors = false)
: base(BoundKind.SwitchStatement, syntax, hasErrors || expression.HasErrors() || switchSections.HasErrors() || decisionDag.HasErrors() || defaultLabel.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!innerLocals.IsDefault, "Field 'innerLocals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!innerLocalFunctions.IsDefault, "Field 'innerLocalFunctions' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!switchSections.IsDefault, "Field 'switchSections' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(decisionDag is object, "Field 'decisionDag' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.InnerLocals = innerLocals;
this.InnerLocalFunctions = innerLocalFunctions;
this.SwitchSections = switchSections;
this.DecisionDag = decisionDag;
this.DefaultLabel = defaultLabel;
this.BreakLabel = breakLabel;
}
public BoundExpression Expression { get; }
public ImmutableArray InnerLocals { get; }
public ImmutableArray InnerLocalFunctions { get; }
public ImmutableArray SwitchSections { get; }
public BoundDecisionDag DecisionDag { get; }
public BoundSwitchLabel? DefaultLabel { get; }
public GeneratedLabelSymbol BreakLabel { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSwitchStatement(this);
public BoundSwitchStatement Update(BoundExpression expression, ImmutableArray innerLocals, ImmutableArray innerLocalFunctions, ImmutableArray switchSections, BoundDecisionDag decisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel)
{
if (expression != this.Expression || innerLocals != this.InnerLocals || innerLocalFunctions != this.InnerLocalFunctions || switchSections != this.SwitchSections || decisionDag != this.DecisionDag || defaultLabel != this.DefaultLabel || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(breakLabel, this.BreakLabel))
{
var result = new BoundSwitchStatement(this.Syntax, expression, innerLocals, innerLocalFunctions, switchSections, decisionDag, defaultLabel, breakLabel, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSwitchDispatch : BoundStatement
{
public BoundSwitchDispatch(SyntaxNode syntax, BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, MethodSymbol? equalityMethod, bool hasErrors = false)
: base(BoundKind.SwitchDispatch, syntax, hasErrors || expression.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!cases.IsDefault, "Field 'cases' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(defaultLabel is object, "Field 'defaultLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.Cases = cases;
this.DefaultLabel = defaultLabel;
this.EqualityMethod = equalityMethod;
}
public BoundExpression Expression { get; }
public ImmutableArray<(ConstantValue value, LabelSymbol label)> Cases { get; }
public LabelSymbol DefaultLabel { get; }
public MethodSymbol? EqualityMethod { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSwitchDispatch(this);
public BoundSwitchDispatch Update(BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, MethodSymbol? equalityMethod)
{
if (expression != this.Expression || cases != this.Cases || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(defaultLabel, this.DefaultLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(equalityMethod, this.EqualityMethod))
{
var result = new BoundSwitchDispatch(this.Syntax, expression, cases, defaultLabel, equalityMethod, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundIfStatement : BoundStatement
{
public BoundIfStatement(SyntaxNode syntax, BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt, bool hasErrors = false)
: base(BoundKind.IfStatement, syntax, hasErrors || condition.HasErrors() || consequence.HasErrors() || alternativeOpt.HasErrors())
{
Debug.Assert(condition is object, "Field 'condition' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(consequence is object, "Field 'consequence' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Condition = condition;
this.Consequence = consequence;
this.AlternativeOpt = alternativeOpt;
}
public BoundExpression Condition { get; }
public BoundStatement Consequence { get; }
public BoundStatement? AlternativeOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitIfStatement(this);
public BoundIfStatement Update(BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt)
{
if (condition != this.Condition || consequence != this.Consequence || alternativeOpt != this.AlternativeOpt)
{
var result = new BoundIfStatement(this.Syntax, condition, consequence, alternativeOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundLoopStatement : BoundStatement
{
protected BoundLoopStatement(BoundKind kind, SyntaxNode syntax, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors)
: base(kind, syntax, hasErrors)
{
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(continueLabel is object, "Field 'continueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.BreakLabel = breakLabel;
this.ContinueLabel = continueLabel;
}
protected BoundLoopStatement(BoundKind kind, SyntaxNode syntax, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
: base(kind, syntax)
{
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(continueLabel is object, "Field 'continueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.BreakLabel = breakLabel;
this.ContinueLabel = continueLabel;
}
public GeneratedLabelSymbol BreakLabel { get; }
public GeneratedLabelSymbol ContinueLabel { get; }
}
internal abstract partial class BoundConditionalLoopStatement : BoundLoopStatement
{
protected BoundConditionalLoopStatement(BoundKind kind, SyntaxNode syntax, ImmutableArray locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
: base(kind, syntax, breakLabel, continueLabel, hasErrors)
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(condition is object, "Field 'condition' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(continueLabel is object, "Field 'continueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.Condition = condition;
this.Body = body;
}
public ImmutableArray Locals { get; }
public BoundExpression Condition { get; }
public BoundStatement Body { get; }
}
internal sealed partial class BoundDoStatement : BoundConditionalLoopStatement
{
public BoundDoStatement(SyntaxNode syntax, ImmutableArray locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
: base(BoundKind.DoStatement, syntax, locals, condition, body, breakLabel, continueLabel, hasErrors || condition.HasErrors() || body.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(condition is object, "Field 'condition' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(continueLabel is object, "Field 'continueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDoStatement(this);
public BoundDoStatement Update(ImmutableArray locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
{
if (locals != this.Locals || condition != this.Condition || body != this.Body || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(breakLabel, this.BreakLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(continueLabel, this.ContinueLabel))
{
var result = new BoundDoStatement(this.Syntax, locals, condition, body, breakLabel, continueLabel, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundWhileStatement : BoundConditionalLoopStatement
{
public BoundWhileStatement(SyntaxNode syntax, ImmutableArray locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
: base(BoundKind.WhileStatement, syntax, locals, condition, body, breakLabel, continueLabel, hasErrors || condition.HasErrors() || body.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(condition is object, "Field 'condition' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(continueLabel is object, "Field 'continueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitWhileStatement(this);
public BoundWhileStatement Update(ImmutableArray locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
{
if (locals != this.Locals || condition != this.Condition || body != this.Body || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(breakLabel, this.BreakLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(continueLabel, this.ContinueLabel))
{
var result = new BoundWhileStatement(this.Syntax, locals, condition, body, breakLabel, continueLabel, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundForStatement : BoundLoopStatement
{
public BoundForStatement(SyntaxNode syntax, ImmutableArray outerLocals, BoundStatement? initializer, ImmutableArray innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
: base(BoundKind.ForStatement, syntax, breakLabel, continueLabel, hasErrors || initializer.HasErrors() || condition.HasErrors() || increment.HasErrors() || body.HasErrors())
{
Debug.Assert(!outerLocals.IsDefault, "Field 'outerLocals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!innerLocals.IsDefault, "Field 'innerLocals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(continueLabel is object, "Field 'continueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.OuterLocals = outerLocals;
this.Initializer = initializer;
this.InnerLocals = innerLocals;
this.Condition = condition;
this.Increment = increment;
this.Body = body;
}
public ImmutableArray OuterLocals { get; }
public BoundStatement? Initializer { get; }
public ImmutableArray InnerLocals { get; }
public BoundExpression? Condition { get; }
public BoundStatement? Increment { get; }
public BoundStatement Body { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitForStatement(this);
public BoundForStatement Update(ImmutableArray outerLocals, BoundStatement? initializer, ImmutableArray innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
{
if (outerLocals != this.OuterLocals || initializer != this.Initializer || innerLocals != this.InnerLocals || condition != this.Condition || increment != this.Increment || body != this.Body || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(breakLabel, this.BreakLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(continueLabel, this.ContinueLabel))
{
var result = new BoundForStatement(this.Syntax, outerLocals, initializer, innerLocals, condition, increment, body, breakLabel, continueLabel, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundForEachStatement : BoundLoopStatement
{
public BoundForEachStatement(SyntaxNode syntax, ForEachEnumeratorInfo? enumeratorInfoOpt, Conversion elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, bool @checked, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
: base(BoundKind.ForEachStatement, syntax, breakLabel, continueLabel, hasErrors || iterationVariableType.HasErrors() || iterationErrorExpressionOpt.HasErrors() || expression.HasErrors() || deconstructionOpt.HasErrors() || awaitOpt.HasErrors() || body.HasErrors())
{
Debug.Assert(iterationVariableType is object, "Field 'iterationVariableType' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!iterationVariables.IsDefault, "Field 'iterationVariables' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(breakLabel is object, "Field 'breakLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(continueLabel is object, "Field 'continueLabel' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.EnumeratorInfoOpt = enumeratorInfoOpt;
this.ElementConversion = elementConversion;
this.IterationVariableType = iterationVariableType;
this.IterationVariables = iterationVariables;
this.IterationErrorExpressionOpt = iterationErrorExpressionOpt;
this.Expression = expression;
this.DeconstructionOpt = deconstructionOpt;
this.AwaitOpt = awaitOpt;
this.Body = body;
this.Checked = @checked;
}
public ForEachEnumeratorInfo? EnumeratorInfoOpt { get; }
public Conversion ElementConversion { get; }
public BoundTypeExpression IterationVariableType { get; }
public ImmutableArray IterationVariables { get; }
public BoundExpression? IterationErrorExpressionOpt { get; }
public BoundExpression Expression { get; }
public BoundForEachDeconstructStep? DeconstructionOpt { get; }
public BoundAwaitableInfo? AwaitOpt { get; }
public BoundStatement Body { get; }
public bool Checked { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitForEachStatement(this);
public BoundForEachStatement Update(ForEachEnumeratorInfo? enumeratorInfoOpt, Conversion elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, bool @checked, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
{
if (enumeratorInfoOpt != this.EnumeratorInfoOpt || elementConversion != this.ElementConversion || iterationVariableType != this.IterationVariableType || iterationVariables != this.IterationVariables || iterationErrorExpressionOpt != this.IterationErrorExpressionOpt || expression != this.Expression || deconstructionOpt != this.DeconstructionOpt || awaitOpt != this.AwaitOpt || body != this.Body || @checked != this.Checked || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(breakLabel, this.BreakLabel) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(continueLabel, this.ContinueLabel))
{
var result = new BoundForEachStatement(this.Syntax, enumeratorInfoOpt, elementConversion, iterationVariableType, iterationVariables, iterationErrorExpressionOpt, expression, deconstructionOpt, awaitOpt, body, @checked, breakLabel, continueLabel, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundForEachDeconstructStep : BoundNode
{
public BoundForEachDeconstructStep(SyntaxNode syntax, BoundDeconstructionAssignmentOperator deconstructionAssignment, BoundDeconstructValuePlaceholder targetPlaceholder, bool hasErrors = false)
: base(BoundKind.ForEachDeconstructStep, syntax, hasErrors || deconstructionAssignment.HasErrors() || targetPlaceholder.HasErrors())
{
Debug.Assert(deconstructionAssignment is object, "Field 'deconstructionAssignment' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(targetPlaceholder is object, "Field 'targetPlaceholder' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.DeconstructionAssignment = deconstructionAssignment;
this.TargetPlaceholder = targetPlaceholder;
}
public BoundDeconstructionAssignmentOperator DeconstructionAssignment { get; }
public BoundDeconstructValuePlaceholder TargetPlaceholder { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitForEachDeconstructStep(this);
public BoundForEachDeconstructStep Update(BoundDeconstructionAssignmentOperator deconstructionAssignment, BoundDeconstructValuePlaceholder targetPlaceholder)
{
if (deconstructionAssignment != this.DeconstructionAssignment || targetPlaceholder != this.TargetPlaceholder)
{
var result = new BoundForEachDeconstructStep(this.Syntax, deconstructionAssignment, targetPlaceholder, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundUsingStatement : BoundStatement
{
public BoundUsingStatement(SyntaxNode syntax, ImmutableArray locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, Conversion iDisposableConversion, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodSymbol? disposeMethodOpt, bool hasErrors = false)
: base(BoundKind.UsingStatement, syntax, hasErrors || declarationsOpt.HasErrors() || expressionOpt.HasErrors() || body.HasErrors() || awaitOpt.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.DeclarationsOpt = declarationsOpt;
this.ExpressionOpt = expressionOpt;
this.IDisposableConversion = iDisposableConversion;
this.Body = body;
this.AwaitOpt = awaitOpt;
this.DisposeMethodOpt = disposeMethodOpt;
}
public ImmutableArray Locals { get; }
public BoundMultipleLocalDeclarations? DeclarationsOpt { get; }
public BoundExpression? ExpressionOpt { get; }
public Conversion IDisposableConversion { get; }
public BoundStatement Body { get; }
public BoundAwaitableInfo? AwaitOpt { get; }
public MethodSymbol? DisposeMethodOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitUsingStatement(this);
public BoundUsingStatement Update(ImmutableArray locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, Conversion iDisposableConversion, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodSymbol? disposeMethodOpt)
{
if (locals != this.Locals || declarationsOpt != this.DeclarationsOpt || expressionOpt != this.ExpressionOpt || iDisposableConversion != this.IDisposableConversion || body != this.Body || awaitOpt != this.AwaitOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(disposeMethodOpt, this.DisposeMethodOpt))
{
var result = new BoundUsingStatement(this.Syntax, locals, declarationsOpt, expressionOpt, iDisposableConversion, body, awaitOpt, disposeMethodOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundFixedStatement : BoundStatement
{
public BoundFixedStatement(SyntaxNode syntax, ImmutableArray locals, BoundMultipleLocalDeclarations declarations, BoundStatement body, bool hasErrors = false)
: base(BoundKind.FixedStatement, syntax, hasErrors || declarations.HasErrors() || body.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(declarations is object, "Field 'declarations' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.Declarations = declarations;
this.Body = body;
}
public ImmutableArray Locals { get; }
public BoundMultipleLocalDeclarations Declarations { get; }
public BoundStatement Body { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitFixedStatement(this);
public BoundFixedStatement Update(ImmutableArray locals, BoundMultipleLocalDeclarations declarations, BoundStatement body)
{
if (locals != this.Locals || declarations != this.Declarations || body != this.Body)
{
var result = new BoundFixedStatement(this.Syntax, locals, declarations, body, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLockStatement : BoundStatement
{
public BoundLockStatement(SyntaxNode syntax, BoundExpression argument, BoundStatement body, bool hasErrors = false)
: base(BoundKind.LockStatement, syntax, hasErrors || argument.HasErrors() || body.HasErrors())
{
Debug.Assert(argument is object, "Field 'argument' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Argument = argument;
this.Body = body;
}
public BoundExpression Argument { get; }
public BoundStatement Body { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLockStatement(this);
public BoundLockStatement Update(BoundExpression argument, BoundStatement body)
{
if (argument != this.Argument || body != this.Body)
{
var result = new BoundLockStatement(this.Syntax, argument, body, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundTryStatement : BoundStatement
{
public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false)
: base(BoundKind.TryStatement, syntax, hasErrors || tryBlock.HasErrors() || catchBlocks.HasErrors() || finallyBlockOpt.HasErrors())
{
Debug.Assert(tryBlock is object, "Field 'tryBlock' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!catchBlocks.IsDefault, "Field 'catchBlocks' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.TryBlock = tryBlock;
this.CatchBlocks = catchBlocks;
this.FinallyBlockOpt = finallyBlockOpt;
this.FinallyLabelOpt = finallyLabelOpt;
this.PreferFaultHandler = preferFaultHandler;
}
public BoundBlock TryBlock { get; }
public ImmutableArray CatchBlocks { get; }
public BoundBlock? FinallyBlockOpt { get; }
public LabelSymbol? FinallyLabelOpt { get; }
public bool PreferFaultHandler { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTryStatement(this);
public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler)
{
if (tryBlock != this.TryBlock || catchBlocks != this.CatchBlocks || finallyBlockOpt != this.FinallyBlockOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(finallyLabelOpt, this.FinallyLabelOpt) || preferFaultHandler != this.PreferFaultHandler)
{
var result = new BoundTryStatement(this.Syntax, tryBlock, catchBlocks, finallyBlockOpt, finallyLabelOpt, preferFaultHandler, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundCatchBlock : BoundNode
{
public BoundCatchBlock(SyntaxNode syntax, ImmutableArray locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false)
: base(BoundKind.CatchBlock, syntax, hasErrors || exceptionSourceOpt.HasErrors() || exceptionFilterOpt.HasErrors() || body.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.ExceptionSourceOpt = exceptionSourceOpt;
this.ExceptionTypeOpt = exceptionTypeOpt;
this.ExceptionFilterOpt = exceptionFilterOpt;
this.Body = body;
this.IsSynthesizedAsyncCatchAll = isSynthesizedAsyncCatchAll;
}
public ImmutableArray Locals { get; }
public BoundExpression? ExceptionSourceOpt { get; }
public TypeSymbol? ExceptionTypeOpt { get; }
public BoundExpression? ExceptionFilterOpt { get; }
public BoundBlock Body { get; }
public bool IsSynthesizedAsyncCatchAll { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitCatchBlock(this);
public BoundCatchBlock Update(ImmutableArray locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll)
{
if (locals != this.Locals || exceptionSourceOpt != this.ExceptionSourceOpt || !TypeSymbol.Equals(exceptionTypeOpt, this.ExceptionTypeOpt, TypeCompareKind.ConsiderEverything) || exceptionFilterOpt != this.ExceptionFilterOpt || body != this.Body || isSynthesizedAsyncCatchAll != this.IsSynthesizedAsyncCatchAll)
{
var result = new BoundCatchBlock(this.Syntax, locals, exceptionSourceOpt, exceptionTypeOpt, exceptionFilterOpt, body, isSynthesizedAsyncCatchAll, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLiteral : BoundExpression
{
public BoundLiteral(SyntaxNode syntax, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors)
: base(BoundKind.Literal, syntax, type, hasErrors)
{
this.ConstantValueOpt = constantValueOpt;
}
public BoundLiteral(SyntaxNode syntax, ConstantValue? constantValueOpt, TypeSymbol? type)
: base(BoundKind.Literal, syntax, type)
{
this.ConstantValueOpt = constantValueOpt;
}
public ConstantValue? ConstantValueOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLiteral(this);
public BoundLiteral Update(ConstantValue? constantValueOpt, TypeSymbol? type)
{
if (constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundLiteral(this.Syntax, constantValueOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundThisReference : BoundExpression
{
public BoundThisReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ThisReference, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundThisReference(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ThisReference, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitThisReference(this);
public BoundThisReference Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundThisReference(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundPreviousSubmissionReference : BoundExpression
{
public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.PreviousSubmissionReference, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.PreviousSubmissionReference, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitPreviousSubmissionReference(this);
public BoundPreviousSubmissionReference Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundPreviousSubmissionReference(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundHostObjectMemberReference : BoundExpression
{
public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.HostObjectMemberReference, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.HostObjectMemberReference, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
public new TypeSymbol Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitHostObjectMemberReference(this);
public BoundHostObjectMemberReference Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundHostObjectMemberReference(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundBaseReference : BoundExpression
{
public BoundBaseReference(SyntaxNode syntax, TypeSymbol? type, bool hasErrors)
: base(BoundKind.BaseReference, syntax, type, hasErrors)
{
}
public BoundBaseReference(SyntaxNode syntax, TypeSymbol? type)
: base(BoundKind.BaseReference, syntax, type)
{
}
public new TypeSymbol? Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitBaseReference(this);
public BoundBaseReference Update(TypeSymbol? type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundBaseReference(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLocal : BoundExpression
{
public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type, bool hasErrors)
: base(BoundKind.Local, syntax, type, hasErrors)
{
Debug.Assert(localSymbol is object, "Field 'localSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.DeclarationKind = declarationKind;
this.ConstantValueOpt = constantValueOpt;
this.IsNullableUnknown = isNullableUnknown;
}
public BoundLocal(SyntaxNode syntax, LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type)
: base(BoundKind.Local, syntax, type)
{
Debug.Assert(localSymbol is object, "Field 'localSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.DeclarationKind = declarationKind;
this.ConstantValueOpt = constantValueOpt;
this.IsNullableUnknown = isNullableUnknown;
}
public new TypeSymbol Type => base.Type!;
public LocalSymbol LocalSymbol { get; }
public BoundLocalDeclarationKind DeclarationKind { get; }
public ConstantValue? ConstantValueOpt { get; }
public bool IsNullableUnknown { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLocal(this);
public BoundLocal Update(LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue? constantValueOpt, bool isNullableUnknown, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(localSymbol, this.LocalSymbol) || declarationKind != this.DeclarationKind || constantValueOpt != this.ConstantValueOpt || isNullableUnknown != this.IsNullableUnknown || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundLocal(this.Syntax, localSymbol, declarationKind, constantValueOpt, isNullableUnknown, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundPseudoVariable : BoundExpression
{
public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type, bool hasErrors)
: base(BoundKind.PseudoVariable, syntax, type, hasErrors)
{
Debug.Assert(localSymbol is object, "Field 'localSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(emitExpressions is object, "Field 'emitExpressions' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.EmitExpressions = emitExpressions;
}
public BoundPseudoVariable(SyntaxNode syntax, LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type)
: base(BoundKind.PseudoVariable, syntax, type)
{
Debug.Assert(localSymbol is object, "Field 'localSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(emitExpressions is object, "Field 'emitExpressions' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.EmitExpressions = emitExpressions;
}
public new TypeSymbol Type => base.Type!;
public LocalSymbol LocalSymbol { get; }
public PseudoVariableExpressions EmitExpressions { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitPseudoVariable(this);
public BoundPseudoVariable Update(LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(localSymbol, this.LocalSymbol) || emitExpressions != this.EmitExpressions || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundPseudoVariable(this.Syntax, localSymbol, emitExpressions, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundRangeVariable : BoundExpression
{
public BoundRangeVariable(SyntaxNode syntax, RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.RangeVariable, syntax, type, hasErrors || value.HasErrors())
{
Debug.Assert(rangeVariableSymbol is object, "Field 'rangeVariableSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.RangeVariableSymbol = rangeVariableSymbol;
this.Value = value;
}
public new TypeSymbol Type => base.Type!;
public RangeVariableSymbol RangeVariableSymbol { get; }
public BoundExpression Value { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitRangeVariable(this);
public BoundRangeVariable Update(RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(rangeVariableSymbol, this.RangeVariableSymbol) || value != this.Value || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundRangeVariable(this.Syntax, rangeVariableSymbol, value, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundParameter : BoundExpression
{
public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, TypeSymbol type, bool hasErrors)
: base(BoundKind.Parameter, syntax, type, hasErrors)
{
Debug.Assert(parameterSymbol is object, "Field 'parameterSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ParameterSymbol = parameterSymbol;
}
public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, TypeSymbol type)
: base(BoundKind.Parameter, syntax, type)
{
Debug.Assert(parameterSymbol is object, "Field 'parameterSymbol' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ParameterSymbol = parameterSymbol;
}
public new TypeSymbol Type => base.Type!;
public ParameterSymbol ParameterSymbol { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitParameter(this);
public BoundParameter Update(ParameterSymbol parameterSymbol, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(parameterSymbol, this.ParameterSymbol) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundParameter(this.Syntax, parameterSymbol, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLabelStatement : BoundStatement
{
public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors)
: base(BoundKind.LabelStatement, syntax, hasErrors)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label)
: base(BoundKind.LabelStatement, syntax)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public LabelSymbol Label { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLabelStatement(this);
public BoundLabelStatement Update(LabelSymbol label)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label))
{
var result = new BoundLabelStatement(this.Syntax, label, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundGotoStatement : BoundStatement
{
public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt, bool hasErrors = false)
: base(BoundKind.GotoStatement, syntax, hasErrors || caseExpressionOpt.HasErrors() || labelExpressionOpt.HasErrors())
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
this.CaseExpressionOpt = caseExpressionOpt;
this.LabelExpressionOpt = labelExpressionOpt;
}
public LabelSymbol Label { get; }
public BoundExpression? CaseExpressionOpt { get; }
public BoundLabel? LabelExpressionOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitGotoStatement(this);
public BoundGotoStatement Update(LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label) || caseExpressionOpt != this.CaseExpressionOpt || labelExpressionOpt != this.LabelExpressionOpt)
{
var result = new BoundGotoStatement(this.Syntax, label, caseExpressionOpt, labelExpressionOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLabeledStatement : BoundStatement
{
public BoundLabeledStatement(SyntaxNode syntax, LabelSymbol label, BoundStatement body, bool hasErrors = false)
: base(BoundKind.LabeledStatement, syntax, hasErrors || body.HasErrors())
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(body is object, "Field 'body' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
this.Body = body;
}
public LabelSymbol Label { get; }
public BoundStatement Body { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLabeledStatement(this);
public BoundLabeledStatement Update(LabelSymbol label, BoundStatement body)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label) || body != this.Body)
{
var result = new BoundLabeledStatement(this.Syntax, label, body, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLabel : BoundExpression
{
public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type, bool hasErrors)
: base(BoundKind.Label, syntax, type, hasErrors)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type)
: base(BoundKind.Label, syntax, type)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public LabelSymbol Label { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLabel(this);
public BoundLabel Update(LabelSymbol label, TypeSymbol? type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundLabel(this.Syntax, label, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal partial class BoundStatementList : BoundStatement
{
protected BoundStatementList(BoundKind kind, SyntaxNode syntax, ImmutableArray statements, bool hasErrors = false)
: base(kind, syntax, hasErrors)
{
Debug.Assert(!statements.IsDefault, "Field 'statements' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Statements = statements;
}
public BoundStatementList(SyntaxNode syntax, ImmutableArray statements, bool hasErrors = false)
: base(BoundKind.StatementList, syntax, hasErrors || statements.HasErrors())
{
Debug.Assert(!statements.IsDefault, "Field 'statements' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Statements = statements;
}
public ImmutableArray Statements { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitStatementList(this);
public BoundStatementList Update(ImmutableArray statements)
{
if (statements != this.Statements)
{
var result = new BoundStatementList(this.Syntax, statements, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundConditionalGoto : BoundStatement
{
public BoundConditionalGoto(SyntaxNode syntax, BoundExpression condition, bool jumpIfTrue, LabelSymbol label, bool hasErrors = false)
: base(BoundKind.ConditionalGoto, syntax, hasErrors || condition.HasErrors())
{
Debug.Assert(condition is object, "Field 'condition' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Condition = condition;
this.JumpIfTrue = jumpIfTrue;
this.Label = label;
}
public BoundExpression Condition { get; }
public bool JumpIfTrue { get; }
public LabelSymbol Label { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitConditionalGoto(this);
public BoundConditionalGoto Update(BoundExpression condition, bool jumpIfTrue, LabelSymbol label)
{
if (condition != this.Condition || jumpIfTrue != this.JumpIfTrue || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label))
{
var result = new BoundConditionalGoto(this.Syntax, condition, jumpIfTrue, label, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundSwitchExpression : BoundExpression
{
protected BoundSwitchExpression(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray switchArms, BoundDecisionDag decisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!switchArms.IsDefault, "Field 'switchArms' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(decisionDag is object, "Field 'decisionDag' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.SwitchArms = switchArms;
this.DecisionDag = decisionDag;
this.DefaultLabel = defaultLabel;
this.ReportedNotExhaustive = reportedNotExhaustive;
}
public BoundExpression Expression { get; }
public ImmutableArray SwitchArms { get; }
public BoundDecisionDag DecisionDag { get; }
public LabelSymbol? DefaultLabel { get; }
public bool ReportedNotExhaustive { get; }
}
internal sealed partial class BoundSwitchExpressionArm : BoundNode
{
public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false)
: base(BoundKind.SwitchExpressionArm, syntax, hasErrors || pattern.HasErrors() || whenClause.HasErrors() || value.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(pattern is object, "Field 'pattern' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.Pattern = pattern;
this.WhenClause = whenClause;
this.Value = value;
this.Label = label;
}
public ImmutableArray Locals { get; }
public BoundPattern Pattern { get; }
public BoundExpression? WhenClause { get; }
public BoundExpression Value { get; }
public LabelSymbol Label { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSwitchExpressionArm(this);
public BoundSwitchExpressionArm Update(ImmutableArray locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label)
{
if (locals != this.Locals || pattern != this.Pattern || whenClause != this.WhenClause || value != this.Value || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label))
{
var result = new BoundSwitchExpressionArm(this.Syntax, locals, pattern, whenClause, value, label, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundUnconvertedSwitchExpression : BoundSwitchExpression
{
public BoundUnconvertedSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray switchArms, BoundDecisionDag decisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.UnconvertedSwitchExpression, syntax, expression, switchArms, decisionDag, defaultLabel, reportedNotExhaustive, type, hasErrors || expression.HasErrors() || switchArms.HasErrors() || decisionDag.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!switchArms.IsDefault, "Field 'switchArms' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(decisionDag is object, "Field 'decisionDag' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitUnconvertedSwitchExpression(this);
public BoundUnconvertedSwitchExpression Update(BoundExpression expression, ImmutableArray switchArms, BoundDecisionDag decisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type)
{
if (expression != this.Expression || switchArms != this.SwitchArms || decisionDag != this.DecisionDag || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(defaultLabel, this.DefaultLabel) || reportedNotExhaustive != this.ReportedNotExhaustive || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundUnconvertedSwitchExpression(this.Syntax, expression, switchArms, decisionDag, defaultLabel, reportedNotExhaustive, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundConvertedSwitchExpression : BoundSwitchExpression
{
public BoundConvertedSwitchExpression(SyntaxNode syntax, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray switchArms, BoundDecisionDag decisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ConvertedSwitchExpression, syntax, expression, switchArms, decisionDag, defaultLabel, reportedNotExhaustive, type, hasErrors || expression.HasErrors() || switchArms.HasErrors() || decisionDag.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!switchArms.IsDefault, "Field 'switchArms' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(decisionDag is object, "Field 'decisionDag' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.NaturalTypeOpt = naturalTypeOpt;
this.WasTargetTyped = wasTargetTyped;
}
public new TypeSymbol Type => base.Type!;
public TypeSymbol? NaturalTypeOpt { get; }
public bool WasTargetTyped { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitConvertedSwitchExpression(this);
public BoundConvertedSwitchExpression Update(TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray switchArms, BoundDecisionDag decisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type)
{
if (!TypeSymbol.Equals(naturalTypeOpt, this.NaturalTypeOpt, TypeCompareKind.ConsiderEverything) || wasTargetTyped != this.WasTargetTyped || expression != this.Expression || switchArms != this.SwitchArms || decisionDag != this.DecisionDag || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(defaultLabel, this.DefaultLabel) || reportedNotExhaustive != this.ReportedNotExhaustive || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConvertedSwitchExpression(this.Syntax, naturalTypeOpt, wasTargetTyped, expression, switchArms, decisionDag, defaultLabel, reportedNotExhaustive, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDecisionDag : BoundNode
{
public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode, bool hasErrors)
: base(BoundKind.DecisionDag, syntax, hasErrors)
{
Debug.Assert(rootNode is object, "Field 'rootNode' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.RootNode = rootNode;
}
public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode)
: base(BoundKind.DecisionDag, syntax)
{
Debug.Assert(rootNode is object, "Field 'rootNode' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.RootNode = rootNode;
}
public BoundDecisionDagNode RootNode { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDecisionDag(this);
public BoundDecisionDag Update(BoundDecisionDagNode rootNode)
{
if (rootNode != this.RootNode)
{
var result = new BoundDecisionDag(this.Syntax, rootNode, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundDecisionDagNode : BoundNode
{
protected BoundDecisionDagNode (BoundKind kind, SyntaxNode syntax, bool hasErrors)
: base(kind, syntax, hasErrors)
{
}
protected BoundDecisionDagNode (BoundKind kind, SyntaxNode syntax)
: base(kind, syntax)
{
}
}
internal sealed partial class BoundEvaluationDecisionDagNode : BoundDecisionDagNode
{
public BoundEvaluationDecisionDagNode(SyntaxNode syntax, BoundDagEvaluation evaluation, BoundDecisionDagNode next, bool hasErrors = false)
: base(BoundKind.EvaluationDecisionDagNode, syntax, hasErrors || evaluation.HasErrors() || next.HasErrors())
{
Debug.Assert(evaluation is object, "Field 'evaluation' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(next is object, "Field 'next' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Evaluation = evaluation;
this.Next = next;
}
public BoundDagEvaluation Evaluation { get; }
public BoundDecisionDagNode Next { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitEvaluationDecisionDagNode(this);
public BoundEvaluationDecisionDagNode Update(BoundDagEvaluation evaluation, BoundDecisionDagNode next)
{
if (evaluation != this.Evaluation || next != this.Next)
{
var result = new BoundEvaluationDecisionDagNode(this.Syntax, evaluation, next, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundTestDecisionDagNode : BoundDecisionDagNode
{
public BoundTestDecisionDagNode(SyntaxNode syntax, BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, bool hasErrors = false)
: base(BoundKind.TestDecisionDagNode, syntax, hasErrors || test.HasErrors() || whenTrue.HasErrors() || whenFalse.HasErrors())
{
Debug.Assert(test is object, "Field 'test' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(whenTrue is object, "Field 'whenTrue' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(whenFalse is object, "Field 'whenFalse' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Test = test;
this.WhenTrue = whenTrue;
this.WhenFalse = whenFalse;
}
public BoundDagTest Test { get; }
public BoundDecisionDagNode WhenTrue { get; }
public BoundDecisionDagNode WhenFalse { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTestDecisionDagNode(this);
public BoundTestDecisionDagNode Update(BoundDagTest test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse)
{
if (test != this.Test || whenTrue != this.WhenTrue || whenFalse != this.WhenFalse)
{
var result = new BoundTestDecisionDagNode(this.Syntax, test, whenTrue, whenFalse, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundWhenDecisionDagNode : BoundDecisionDagNode
{
public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode ? whenFalse, bool hasErrors = false)
: base(BoundKind.WhenDecisionDagNode, syntax, hasErrors || whenExpression.HasErrors() || whenTrue.HasErrors() || whenFalse.HasErrors())
{
Debug.Assert(!bindings.IsDefault, "Field 'bindings' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(whenTrue is object, "Field 'whenTrue' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Bindings = bindings;
this.WhenExpression = whenExpression;
this.WhenTrue = whenTrue;
this.WhenFalse = whenFalse;
}
public ImmutableArray Bindings { get; }
public BoundExpression? WhenExpression { get; }
public BoundDecisionDagNode WhenTrue { get; }
public BoundDecisionDagNode ? WhenFalse { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitWhenDecisionDagNode(this);
public BoundWhenDecisionDagNode Update(ImmutableArray bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode ? whenFalse)
{
if (bindings != this.Bindings || whenExpression != this.WhenExpression || whenTrue != this.WhenTrue || whenFalse != this.WhenFalse)
{
var result = new BoundWhenDecisionDagNode(this.Syntax, bindings, whenExpression, whenTrue, whenFalse, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLeafDecisionDagNode : BoundDecisionDagNode
{
public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label, bool hasErrors)
: base(BoundKind.LeafDecisionDagNode, syntax, hasErrors)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label)
: base(BoundKind.LeafDecisionDagNode, syntax)
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
}
public LabelSymbol Label { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLeafDecisionDagNode(this);
public BoundLeafDecisionDagNode Update(LabelSymbol label)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label))
{
var result = new BoundLeafDecisionDagNode(this.Syntax, label, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundDagTest : BoundNode
{
protected BoundDagTest(BoundKind kind, SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false)
: base(kind, syntax, hasErrors)
{
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Input = input;
}
public BoundDagTemp Input { get; }
}
internal sealed partial class BoundDagTemp : BoundNode
{
public BoundDagTemp(SyntaxNode syntax, TypeSymbol type, BoundDagEvaluation? source, int index, bool hasErrors = false)
: base(BoundKind.DagTemp, syntax, hasErrors || source.HasErrors())
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Type = type;
this.Source = source;
this.Index = index;
}
public TypeSymbol Type { get; }
public BoundDagEvaluation? Source { get; }
public int Index { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagTemp(this);
public BoundDagTemp Update(TypeSymbol type, BoundDagEvaluation? source, int index)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything) || source != this.Source || index != this.Index)
{
var result = new BoundDagTemp(this.Syntax, type, source, index, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagTypeTest : BoundDagTest
{
public BoundDagTypeTest(SyntaxNode syntax, TypeSymbol type, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagTypeTest, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Type = type;
}
public TypeSymbol Type { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagTypeTest(this);
public BoundDagTypeTest Update(TypeSymbol type, BoundDagTemp input)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything) || input != this.Input)
{
var result = new BoundDagTypeTest(this.Syntax, type, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagNonNullTest : BoundDagTest
{
public BoundDagNonNullTest(SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagNonNullTest, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagNonNullTest(this);
public BoundDagNonNullTest Update(BoundDagTemp input)
{
if (input != this.Input)
{
var result = new BoundDagNonNullTest(this.Syntax, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagExplicitNullTest : BoundDagTest
{
public BoundDagExplicitNullTest(SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagExplicitNullTest, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagExplicitNullTest(this);
public BoundDagExplicitNullTest Update(BoundDagTemp input)
{
if (input != this.Input)
{
var result = new BoundDagExplicitNullTest(this.Syntax, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagValueTest : BoundDagTest
{
public BoundDagValueTest(SyntaxNode syntax, ConstantValue value, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagValueTest, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Value = value;
}
public ConstantValue Value { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagValueTest(this);
public BoundDagValueTest Update(ConstantValue value, BoundDagTemp input)
{
if (value != this.Value || input != this.Input)
{
var result = new BoundDagValueTest(this.Syntax, value, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundDagEvaluation : BoundDagTest
{
protected BoundDagEvaluation(BoundKind kind, SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false)
: base(kind, syntax, input, hasErrors)
{
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
}
internal sealed partial class BoundDagDeconstructEvaluation : BoundDagEvaluation
{
public BoundDagDeconstructEvaluation(SyntaxNode syntax, MethodSymbol deconstructMethod, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagDeconstructEvaluation, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(deconstructMethod is object, "Field 'deconstructMethod' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.DeconstructMethod = deconstructMethod;
}
public MethodSymbol DeconstructMethod { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagDeconstructEvaluation(this);
public BoundDagDeconstructEvaluation Update(MethodSymbol deconstructMethod, BoundDagTemp input)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(deconstructMethod, this.DeconstructMethod) || input != this.Input)
{
var result = new BoundDagDeconstructEvaluation(this.Syntax, deconstructMethod, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagTypeEvaluation : BoundDagEvaluation
{
public BoundDagTypeEvaluation(SyntaxNode syntax, TypeSymbol type, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagTypeEvaluation, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Type = type;
}
public TypeSymbol Type { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagTypeEvaluation(this);
public BoundDagTypeEvaluation Update(TypeSymbol type, BoundDagTemp input)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything) || input != this.Input)
{
var result = new BoundDagTypeEvaluation(this.Syntax, type, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagFieldEvaluation : BoundDagEvaluation
{
public BoundDagFieldEvaluation(SyntaxNode syntax, FieldSymbol field, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagFieldEvaluation, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(field is object, "Field 'field' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Field = field;
}
public FieldSymbol Field { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagFieldEvaluation(this);
public BoundDagFieldEvaluation Update(FieldSymbol field, BoundDagTemp input)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(field, this.Field) || input != this.Input)
{
var result = new BoundDagFieldEvaluation(this.Syntax, field, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagPropertyEvaluation : BoundDagEvaluation
{
public BoundDagPropertyEvaluation(SyntaxNode syntax, PropertySymbol property, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagPropertyEvaluation, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(property is object, "Field 'property' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Property = property;
}
public PropertySymbol Property { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagPropertyEvaluation(this);
public BoundDagPropertyEvaluation Update(PropertySymbol property, BoundDagTemp input)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(property, this.Property) || input != this.Input)
{
var result = new BoundDagPropertyEvaluation(this.Syntax, property, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDagIndexEvaluation : BoundDagEvaluation
{
public BoundDagIndexEvaluation(SyntaxNode syntax, PropertySymbol property, int index, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagIndexEvaluation, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert(property is object, "Field 'property' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(input is object, "Field 'input' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Property = property;
this.Index = index;
}
public PropertySymbol Property { get; }
public int Index { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDagIndexEvaluation(this);
public BoundDagIndexEvaluation Update(PropertySymbol property, int index, BoundDagTemp input)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(property, this.Property) || index != this.Index || input != this.Input)
{
var result = new BoundDagIndexEvaluation(this.Syntax, property, index, input, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSwitchSection : BoundStatementList
{
public BoundSwitchSection(SyntaxNode syntax, ImmutableArray locals, ImmutableArray switchLabels, ImmutableArray statements, bool hasErrors = false)
: base(BoundKind.SwitchSection, syntax, statements, hasErrors || switchLabels.HasErrors() || statements.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!switchLabels.IsDefault, "Field 'switchLabels' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!statements.IsDefault, "Field 'statements' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.SwitchLabels = switchLabels;
}
public ImmutableArray Locals { get; }
public ImmutableArray SwitchLabels { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSwitchSection(this);
public BoundSwitchSection Update(ImmutableArray locals, ImmutableArray switchLabels, ImmutableArray statements)
{
if (locals != this.Locals || switchLabels != this.SwitchLabels || statements != this.Statements)
{
var result = new BoundSwitchSection(this.Syntax, locals, switchLabels, statements, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSwitchLabel : BoundNode
{
public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause, bool hasErrors = false)
: base(BoundKind.SwitchLabel, syntax, hasErrors || pattern.HasErrors() || whenClause.HasErrors())
{
Debug.Assert(label is object, "Field 'label' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(pattern is object, "Field 'pattern' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Label = label;
this.Pattern = pattern;
this.WhenClause = whenClause;
}
public LabelSymbol Label { get; }
public BoundPattern Pattern { get; }
public BoundExpression? WhenClause { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSwitchLabel(this);
public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(label, this.Label) || pattern != this.Pattern || whenClause != this.WhenClause)
{
var result = new BoundSwitchLabel(this.Syntax, label, pattern, whenClause, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundMethodOrPropertyGroup : BoundExpression
{
protected BoundMethodOrPropertyGroup(BoundKind kind, SyntaxNode syntax, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
: base(kind, syntax, null, hasErrors)
{
this.ReceiverOpt = receiverOpt;
this._ResultKind = resultKind;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression? ReceiverOpt { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
}
internal sealed partial class BoundSequencePointExpression : BoundExpression
{
public BoundSequencePointExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.SequencePointExpression, syntax, type, hasErrors || expression.HasErrors())
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSequencePointExpression(this);
public BoundSequencePointExpression Update(BoundExpression expression, TypeSymbol? type)
{
if (expression != this.Expression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundSequencePointExpression(this.Syntax, expression, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSequence : BoundExpression
{
public BoundSequence(SyntaxNode syntax, ImmutableArray locals, ImmutableArray sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.Sequence, syntax, type, hasErrors || sideEffects.HasErrors() || value.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!sideEffects.IsDefault, "Field 'sideEffects' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.SideEffects = sideEffects;
this.Value = value;
}
public new TypeSymbol Type => base.Type!;
public ImmutableArray Locals { get; }
public ImmutableArray SideEffects { get; }
public BoundExpression Value { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSequence(this);
public BoundSequence Update(ImmutableArray locals, ImmutableArray sideEffects, BoundExpression value, TypeSymbol type)
{
if (locals != this.Locals || sideEffects != this.SideEffects || value != this.Value || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundSequence(this.Syntax, locals, sideEffects, value, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSpillSequence : BoundExpression
{
public BoundSpillSequence(SyntaxNode syntax, ImmutableArray locals, ImmutableArray sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.SpillSequence, syntax, type, hasErrors || sideEffects.HasErrors() || value.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!sideEffects.IsDefault, "Field 'sideEffects' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(value is object, "Field 'value' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.SideEffects = sideEffects;
this.Value = value;
}
public new TypeSymbol Type => base.Type!;
public ImmutableArray Locals { get; }
public ImmutableArray SideEffects { get; }
public BoundExpression Value { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitSpillSequence(this);
public BoundSpillSequence Update(ImmutableArray locals, ImmutableArray sideEffects, BoundExpression value, TypeSymbol type)
{
if (locals != this.Locals || sideEffects != this.SideEffects || value != this.Value || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundSpillSequence(this.Syntax, locals, sideEffects, value, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDynamicMemberAccess : BoundExpression
{
public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.DynamicMemberAccess, syntax, type, hasErrors || receiver.HasErrors())
{
Debug.Assert(receiver is object, "Field 'receiver' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(name is object, "Field 'name' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Receiver = receiver;
this.TypeArgumentsOpt = typeArgumentsOpt;
this.Name = name;
this.Invoked = invoked;
this.Indexed = indexed;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Receiver { get; }
public ImmutableArray TypeArgumentsOpt { get; }
public string Name { get; }
public bool Invoked { get; }
public bool Indexed { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDynamicMemberAccess(this);
public BoundDynamicMemberAccess Update(BoundExpression receiver, ImmutableArray typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type)
{
if (receiver != this.Receiver || typeArgumentsOpt != this.TypeArgumentsOpt || name != this.Name || invoked != this.Invoked || indexed != this.Indexed || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDynamicMemberAccess(this.Syntax, receiver, typeArgumentsOpt, name, invoked, indexed, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundDynamicInvocableBase : BoundExpression
{
protected BoundDynamicInvocableBase(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray arguments, TypeSymbol? type, bool hasErrors = false)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.Arguments = arguments;
}
public BoundExpression Expression { get; }
public ImmutableArray Arguments { get; }
}
internal sealed partial class BoundDynamicInvocation : BoundDynamicInvocableBase
{
public BoundDynamicInvocation(SyntaxNode syntax, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, ImmutableArray applicableMethods, BoundExpression expression, ImmutableArray arguments, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.DynamicInvocation, syntax, expression, arguments, type, hasErrors || expression.HasErrors() || arguments.HasErrors())
{
Debug.Assert(!applicableMethods.IsDefault, "Field 'applicableMethods' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(expression is object, "Field 'expression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ArgumentNamesOpt = argumentNamesOpt;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
this.ApplicableMethods = applicableMethods;
}
public new TypeSymbol Type => base.Type!;
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public ImmutableArray ApplicableMethods { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDynamicInvocation(this);
public BoundDynamicInvocation Update(ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, ImmutableArray applicableMethods, BoundExpression expression, ImmutableArray arguments, TypeSymbol type)
{
if (argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || applicableMethods != this.ApplicableMethods || expression != this.Expression || arguments != this.Arguments || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDynamicInvocation(this.Syntax, argumentNamesOpt, argumentRefKindsOpt, applicableMethods, expression, arguments, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundConditionalAccess : BoundExpression
{
public BoundConditionalAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ConditionalAccess, syntax, type, hasErrors || receiver.HasErrors() || accessExpression.HasErrors())
{
Debug.Assert(receiver is object, "Field 'receiver' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(accessExpression is object, "Field 'accessExpression' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Receiver = receiver;
this.AccessExpression = accessExpression;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Receiver { get; }
public BoundExpression AccessExpression { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitConditionalAccess(this);
public BoundConditionalAccess Update(BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type)
{
if (receiver != this.Receiver || accessExpression != this.AccessExpression || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConditionalAccess(this.Syntax, receiver, accessExpression, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundLoweredConditionalAccess : BoundExpression
{
public BoundLoweredConditionalAccess(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.LoweredConditionalAccess, syntax, type, hasErrors || receiver.HasErrors() || whenNotNull.HasErrors() || whenNullOpt.HasErrors())
{
Debug.Assert(receiver is object, "Field 'receiver' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(whenNotNull is object, "Field 'whenNotNull' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Receiver = receiver;
this.HasValueMethodOpt = hasValueMethodOpt;
this.WhenNotNull = whenNotNull;
this.WhenNullOpt = whenNullOpt;
this.Id = id;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression Receiver { get; }
public MethodSymbol? HasValueMethodOpt { get; }
public BoundExpression WhenNotNull { get; }
public BoundExpression? WhenNullOpt { get; }
public int Id { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitLoweredConditionalAccess(this);
public BoundLoweredConditionalAccess Update(BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, TypeSymbol type)
{
if (receiver != this.Receiver || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(hasValueMethodOpt, this.HasValueMethodOpt) || whenNotNull != this.WhenNotNull || whenNullOpt != this.WhenNullOpt || id != this.Id || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundLoweredConditionalAccess(this.Syntax, receiver, hasValueMethodOpt, whenNotNull, whenNullOpt, id, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundConditionalReceiver : BoundExpression
{
public BoundConditionalReceiver(SyntaxNode syntax, int id, TypeSymbol type, bool hasErrors)
: base(BoundKind.ConditionalReceiver, syntax, type, hasErrors)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Id = id;
}
public BoundConditionalReceiver(SyntaxNode syntax, int id, TypeSymbol type)
: base(BoundKind.ConditionalReceiver, syntax, type)
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Id = id;
}
public new TypeSymbol Type => base.Type!;
public int Id { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitConditionalReceiver(this);
public BoundConditionalReceiver Update(int id, TypeSymbol type)
{
if (id != this.Id || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConditionalReceiver(this.Syntax, id, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundComplexConditionalReceiver : BoundExpression
{
public BoundComplexConditionalReceiver(SyntaxNode syntax, BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ComplexConditionalReceiver, syntax, type, hasErrors || valueTypeReceiver.HasErrors() || referenceTypeReceiver.HasErrors())
{
Debug.Assert(valueTypeReceiver is object, "Field 'valueTypeReceiver' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(referenceTypeReceiver is object, "Field 'referenceTypeReceiver' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ValueTypeReceiver = valueTypeReceiver;
this.ReferenceTypeReceiver = referenceTypeReceiver;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression ValueTypeReceiver { get; }
public BoundExpression ReferenceTypeReceiver { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitComplexConditionalReceiver(this);
public BoundComplexConditionalReceiver Update(BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type)
{
if (valueTypeReceiver != this.ValueTypeReceiver || referenceTypeReceiver != this.ReferenceTypeReceiver || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundComplexConditionalReceiver(this.Syntax, valueTypeReceiver, referenceTypeReceiver, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundMethodGroup : BoundMethodOrPropertyGroup
{
public BoundMethodGroup(SyntaxNode syntax, ImmutableArray typeArgumentsOpt, string name, ImmutableArray methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
: base(BoundKind.MethodGroup, syntax, receiverOpt, resultKind, hasErrors || receiverOpt.HasErrors())
{
Debug.Assert(name is object, "Field 'name' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!methods.IsDefault, "Field 'methods' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.TypeArgumentsOpt = typeArgumentsOpt;
this.Name = name;
this.Methods = methods;
this.LookupSymbolOpt = lookupSymbolOpt;
this.LookupError = lookupError;
this.Flags = flags;
}
public ImmutableArray TypeArgumentsOpt { get; }
public string Name { get; }
public ImmutableArray Methods { get; }
public Symbol? LookupSymbolOpt { get; }
public DiagnosticInfo? LookupError { get; }
public BoundMethodGroupFlags? Flags { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitMethodGroup(this);
public BoundMethodGroup Update(ImmutableArray typeArgumentsOpt, string name, ImmutableArray methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, BoundExpression? receiverOpt, LookupResultKind resultKind)
{
if (typeArgumentsOpt != this.TypeArgumentsOpt || name != this.Name || methods != this.Methods || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(lookupSymbolOpt, this.LookupSymbolOpt) || lookupError != this.LookupError || flags != this.Flags || receiverOpt != this.ReceiverOpt || resultKind != this.ResultKind)
{
var result = new BoundMethodGroup(this.Syntax, typeArgumentsOpt, name, methods, lookupSymbolOpt, lookupError, flags, receiverOpt, resultKind, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundPropertyGroup : BoundMethodOrPropertyGroup
{
public BoundPropertyGroup(SyntaxNode syntax, ImmutableArray properties, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
: base(BoundKind.PropertyGroup, syntax, receiverOpt, resultKind, hasErrors || receiverOpt.HasErrors())
{
Debug.Assert(!properties.IsDefault, "Field 'properties' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Properties = properties;
}
public ImmutableArray Properties { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitPropertyGroup(this);
public BoundPropertyGroup Update(ImmutableArray properties, BoundExpression? receiverOpt, LookupResultKind resultKind)
{
if (properties != this.Properties || receiverOpt != this.ReceiverOpt || resultKind != this.ResultKind)
{
var result = new BoundPropertyGroup(this.Syntax, properties, receiverOpt, resultKind, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundCall : BoundExpression
{
public BoundCall(SyntaxNode syntax, BoundExpression? receiverOpt, MethodSymbol method, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray argsToParamsOpt, LookupResultKind resultKind, ImmutableArray originalMethodsOpt, Binder? binderOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.Call, syntax, type, hasErrors || receiverOpt.HasErrors() || arguments.HasErrors())
{
Debug.Assert(method is object, "Field 'method' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.ReceiverOpt = receiverOpt;
this.Method = method;
this.Arguments = arguments;
this.ArgumentNamesOpt = argumentNamesOpt;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
this.IsDelegateCall = isDelegateCall;
this.Expanded = expanded;
this.InvokedAsExtensionMethod = invokedAsExtensionMethod;
this.ArgsToParamsOpt = argsToParamsOpt;
this._ResultKind = resultKind;
this.OriginalMethodsOpt = originalMethodsOpt;
this.BinderOpt = binderOpt;
}
public new TypeSymbol Type => base.Type!;
public BoundExpression? ReceiverOpt { get; }
public MethodSymbol Method { get; }
public ImmutableArray Arguments { get; }
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public bool IsDelegateCall { get; }
public bool Expanded { get; }
public bool InvokedAsExtensionMethod { get; }
public ImmutableArray ArgsToParamsOpt { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public ImmutableArray OriginalMethodsOpt { get; }
public Binder? BinderOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitCall(this);
public BoundCall Update(BoundExpression? receiverOpt, MethodSymbol method, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray argsToParamsOpt, LookupResultKind resultKind, ImmutableArray originalMethodsOpt, Binder? binderOpt, TypeSymbol type)
{
if (receiverOpt != this.ReceiverOpt || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(method, this.Method) || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || isDelegateCall != this.IsDelegateCall || expanded != this.Expanded || invokedAsExtensionMethod != this.InvokedAsExtensionMethod || argsToParamsOpt != this.ArgsToParamsOpt || resultKind != this.ResultKind || originalMethodsOpt != this.OriginalMethodsOpt || binderOpt != this.BinderOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundCall(this.Syntax, receiverOpt, method, arguments, argumentNamesOpt, argumentRefKindsOpt, isDelegateCall, expanded, invokedAsExtensionMethod, argsToParamsOpt, resultKind, originalMethodsOpt, binderOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundEventAssignmentOperator : BoundExpression
{
public BoundEventAssignmentOperator(SyntaxNode syntax, EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.EventAssignmentOperator, syntax, type, hasErrors || receiverOpt.HasErrors() || argument.HasErrors())
{
Debug.Assert(@event is object, "Field '@event' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(argument is object, "Field 'argument' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Event = @event;
this.IsAddition = isAddition;
this.IsDynamic = isDynamic;
this.ReceiverOpt = receiverOpt;
this.Argument = argument;
}
public new TypeSymbol Type => base.Type!;
public EventSymbol Event { get; }
public bool IsAddition { get; }
public bool IsDynamic { get; }
public BoundExpression? ReceiverOpt { get; }
public BoundExpression Argument { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitEventAssignmentOperator(this);
public BoundEventAssignmentOperator Update(EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(@event, this.Event) || isAddition != this.IsAddition || isDynamic != this.IsDynamic || receiverOpt != this.ReceiverOpt || argument != this.Argument || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundEventAssignmentOperator(this.Syntax, @event, isAddition, isDynamic, receiverOpt, argument, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundAttribute : BoundExpression
{
public BoundAttribute(SyntaxNode syntax, MethodSymbol? constructor, ImmutableArray constructorArguments, ImmutableArray constructorArgumentNamesOpt, ImmutableArray constructorArgumentsToParamsOpt, bool constructorExpanded, ImmutableArray namedArguments, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.Attribute, syntax, type, hasErrors || constructorArguments.HasErrors() || namedArguments.HasErrors())
{
Debug.Assert(!constructorArguments.IsDefault, "Field 'constructorArguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!namedArguments.IsDefault, "Field 'namedArguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Constructor = constructor;
this.ConstructorArguments = constructorArguments;
this.ConstructorArgumentNamesOpt = constructorArgumentNamesOpt;
this.ConstructorArgumentsToParamsOpt = constructorArgumentsToParamsOpt;
this.ConstructorExpanded = constructorExpanded;
this.NamedArguments = namedArguments;
this._ResultKind = resultKind;
}
public new TypeSymbol Type => base.Type!;
public MethodSymbol? Constructor { get; }
public ImmutableArray ConstructorArguments { get; }
public ImmutableArray ConstructorArgumentNamesOpt { get; }
public ImmutableArray ConstructorArgumentsToParamsOpt { get; }
public bool ConstructorExpanded { get; }
public ImmutableArray NamedArguments { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitAttribute(this);
public BoundAttribute Update(MethodSymbol? constructor, ImmutableArray constructorArguments, ImmutableArray constructorArgumentNamesOpt, ImmutableArray constructorArgumentsToParamsOpt, bool constructorExpanded, ImmutableArray namedArguments, LookupResultKind resultKind, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(constructor, this.Constructor) || constructorArguments != this.ConstructorArguments || constructorArgumentNamesOpt != this.ConstructorArgumentNamesOpt || constructorArgumentsToParamsOpt != this.ConstructorArgumentsToParamsOpt || constructorExpanded != this.ConstructorExpanded || namedArguments != this.NamedArguments || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAttribute(this.Syntax, constructor, constructorArguments, constructorArgumentNamesOpt, constructorArgumentsToParamsOpt, constructorExpanded, namedArguments, resultKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundObjectCreationExpression : BoundExpression
{
public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray constructorsGroup, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool expanded, ImmutableArray argsToParamsOpt, ConstantValue? constantValueOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, Binder? binderOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ObjectCreationExpression, syntax, type, hasErrors || arguments.HasErrors() || initializerExpressionOpt.HasErrors())
{
Debug.Assert(constructor is object, "Field 'constructor' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!constructorsGroup.IsDefault, "Field 'constructorsGroup' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Constructor = constructor;
this.ConstructorsGroup = constructorsGroup;
this.Arguments = arguments;
this.ArgumentNamesOpt = argumentNamesOpt;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
this.Expanded = expanded;
this.ArgsToParamsOpt = argsToParamsOpt;
this.ConstantValueOpt = constantValueOpt;
this.InitializerExpressionOpt = initializerExpressionOpt;
this.BinderOpt = binderOpt;
}
public new TypeSymbol Type => base.Type!;
public MethodSymbol Constructor { get; }
public ImmutableArray ConstructorsGroup { get; }
public ImmutableArray Arguments { get; }
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public bool Expanded { get; }
public ImmutableArray ArgsToParamsOpt { get; }
public ConstantValue? ConstantValueOpt { get; }
public BoundObjectInitializerExpressionBase? InitializerExpressionOpt { get; }
public Binder? BinderOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitObjectCreationExpression(this);
public BoundObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray constructorsGroup, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool expanded, ImmutableArray argsToParamsOpt, ConstantValue? constantValueOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, Binder? binderOpt, TypeSymbol type)
{
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(constructor, this.Constructor) || constructorsGroup != this.ConstructorsGroup || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || expanded != this.Expanded || argsToParamsOpt != this.ArgsToParamsOpt || constantValueOpt != this.ConstantValueOpt || initializerExpressionOpt != this.InitializerExpressionOpt || binderOpt != this.BinderOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundObjectCreationExpression(this.Syntax, constructor, constructorsGroup, arguments, argumentNamesOpt, argumentRefKindsOpt, expanded, argsToParamsOpt, constantValueOpt, initializerExpressionOpt, binderOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundTupleExpression : BoundExpression
{
protected BoundTupleExpression(BoundKind kind, SyntaxNode syntax, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Arguments = arguments;
this.ArgumentNamesOpt = argumentNamesOpt;
this.InferredNamesOpt = inferredNamesOpt;
}
public ImmutableArray Arguments { get; }
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray InferredNamesOpt { get; }
}
internal sealed partial class BoundTupleLiteral : BoundTupleExpression
{
public BoundTupleLiteral(SyntaxNode syntax, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.TupleLiteral, syntax, arguments, argumentNamesOpt, inferredNamesOpt, type, hasErrors || arguments.HasErrors())
{
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public new TypeSymbol? Type => base.Type!;
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitTupleLiteral(this);
public BoundTupleLiteral Update(ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray inferredNamesOpt, TypeSymbol? type)
{
if (arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || inferredNamesOpt != this.InferredNamesOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTupleLiteral(this.Syntax, arguments, argumentNamesOpt, inferredNamesOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundConvertedTupleLiteral : BoundTupleExpression
{
public BoundConvertedTupleLiteral(SyntaxNode syntax, BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
: base(BoundKind.ConvertedTupleLiteral, syntax, arguments, argumentNamesOpt, inferredNamesOpt, type, hasErrors || sourceTuple.HasErrors() || arguments.HasErrors())
{
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.SourceTuple = sourceTuple;
this.WasTargetTyped = wasTargetTyped;
}
public BoundTupleLiteral? SourceTuple { get; }
public bool WasTargetTyped { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitConvertedTupleLiteral(this);
public BoundConvertedTupleLiteral Update(BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray inferredNamesOpt, TypeSymbol? type)
{
if (sourceTuple != this.SourceTuple || wasTargetTyped != this.WasTargetTyped || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || inferredNamesOpt != this.InferredNamesOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConvertedTupleLiteral(this.Syntax, sourceTuple, wasTargetTyped, arguments, argumentNamesOpt, inferredNamesOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundDynamicObjectCreationExpression : BoundExpression
{
public BoundDynamicObjectCreationExpression(SyntaxNode syntax, string name, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray applicableMethods, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.DynamicObjectCreationExpression, syntax, type, hasErrors || arguments.HasErrors() || initializerExpressionOpt.HasErrors())
{
Debug.Assert(name is object, "Field 'name' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(!applicableMethods.IsDefault, "Field 'applicableMethods' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Name = name;
this.Arguments = arguments;
this.ArgumentNamesOpt = argumentNamesOpt;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
this.InitializerExpressionOpt = initializerExpressionOpt;
this.ApplicableMethods = applicableMethods;
}
public new TypeSymbol Type => base.Type!;
public string Name { get; }
public ImmutableArray Arguments { get; }
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public BoundObjectInitializerExpressionBase? InitializerExpressionOpt { get; }
public ImmutableArray ApplicableMethods { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitDynamicObjectCreationExpression(this);
public BoundDynamicObjectCreationExpression Update(string name, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray applicableMethods, TypeSymbol type)
{
if (name != this.Name || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || initializerExpressionOpt != this.InitializerExpressionOpt || applicableMethods != this.ApplicableMethods || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDynamicObjectCreationExpression(this.Syntax, name, arguments, argumentNamesOpt, argumentRefKindsOpt, initializerExpressionOpt, applicableMethods, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundNoPiaObjectCreationExpression : BoundExpression
{
public BoundNoPiaObjectCreationExpression(SyntaxNode syntax, string? guidString, BoundObjectInitializerExpressionBase? initializerExpressionOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.NoPiaObjectCreationExpression, syntax, type, hasErrors || initializerExpressionOpt.HasErrors())
{
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.GuidString = guidString;
this.InitializerExpressionOpt = initializerExpressionOpt;
}
public new TypeSymbol Type => base.Type!;
public string? GuidString { get; }
public BoundObjectInitializerExpressionBase? InitializerExpressionOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitNoPiaObjectCreationExpression(this);
public BoundNoPiaObjectCreationExpression Update(string? guidString, BoundObjectInitializerExpressionBase? initializerExpressionOpt, TypeSymbol type)
{
if (guidString != this.GuidString || initializerExpressionOpt != this.InitializerExpressionOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundNoPiaObjectCreationExpression(this.Syntax, guidString, initializerExpressionOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal abstract partial class BoundObjectInitializerExpressionBase : BoundExpression
{
protected BoundObjectInitializerExpressionBase(BoundKind kind, SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray initializers, TypeSymbol type, bool hasErrors = false)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert(placeholder is object, "Field 'placeholder' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!initializers.IsDefault, "Field 'initializers' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.Placeholder = placeholder;
this.Initializers = initializers;
}
public new TypeSymbol Type => base.Type!;
public BoundObjectOrCollectionValuePlaceholder Placeholder { get; }
public ImmutableArray Initializers { get; }
}
internal sealed partial class BoundObjectInitializerExpression : BoundObjectInitializerExpressionBase
{
public BoundObjectInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray initializers, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ObjectInitializerExpression, syntax, placeholder, initializers, type, hasErrors || placeholder.HasErrors() || initializers.HasErrors())
{
Debug.Assert(placeholder is object, "Field 'placeholder' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(!initializers.IsDefault, "Field 'initializers' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitObjectInitializerExpression(this);
public BoundObjectInitializerExpression Update(BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray initializers, TypeSymbol type)
{
if (placeholder != this.Placeholder || initializers != this.Initializers || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundObjectInitializerExpression(this.Syntax, placeholder, initializers, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundObjectInitializerMember : BoundExpression
{
public BoundObjectInitializerMember(SyntaxNode syntax, Symbol? memberSymbol, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool expanded, ImmutableArray argsToParamsOpt, LookupResultKind resultKind, TypeSymbol receiverType, Binder? binderOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ObjectInitializerMember, syntax, type, hasErrors || arguments.HasErrors())
{
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert(receiverType is object, "Field 'receiverType' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
Debug.Assert(type is object, "Field 'type' cannot be null (make the type nullable in BoundNodes.xml to remove this check)");
this.MemberSymbol = memberSymbol;
this.Arguments = arguments;
this.ArgumentNamesOpt = argumentNamesOpt;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
this.Expanded = expanded;
this.ArgsToParamsOpt = argsToParamsOpt;
this._ResultKind = resultKind;
this.ReceiverType = receiverType;
this.BinderOpt = binderOpt;
}
public new TypeSymbol Type => base.Type!;
public Symbol? MemberSymbol { get; }
public ImmutableArray Arguments { get; }
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public bool Expanded { get; }
public ImmutableArray ArgsToParamsOpt { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public TypeSymbol ReceiverType { get; }
public Binder? BinderOpt { get; }
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor) => visitor.VisitObjectInitializerMember(this);
public BoundObjectInitializerMember Update(Symbol? memberSymbol, ImmutableArray arguments, ImmutableArray