//
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,
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,
AwaitExpression,
TypeOfOperator,
MethodDefIndex,
MaximumMethodDefIndex,
InstrumentationPayloadRoot,
ModuleVersionId,
ModuleVersionIdString,
SourceDocumentIndex,
MethodInfo,
FieldInfo,
DefaultExpression,
IsOperator,
AsOperator,
SizeOfOperator,
Conversion,
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,
SwitchExpression,
SwitchExpressionArm,
DecisionDag,
EvaluationDecisionDagNode,
TestDecisionDagNode,
WhenDecisionDagNode,
LeafDecisionDagNode,
DagTemp,
DagTypeTest,
DagNonNullTest,
DagNullTest,
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,
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((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" 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((object)field != null, "Field 'field' cannot be null (use Null=\"allow\" 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((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Field = field;
}
public FieldSymbol Field { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitFieldEqualsValue(this);
}
public BoundFieldEqualsValue Update(FieldSymbol field, ImmutableArray locals, BoundExpression value)
{
if (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((object)property != null, "Field 'property' cannot be null (use Null=\"allow\" 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((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Property = property;
}
public PropertySymbol Property { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitPropertyEqualsValue(this);
}
public BoundPropertyEqualsValue Update(PropertySymbol property, ImmutableArray locals, BoundExpression value)
{
if (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((object)parameter != null, "Field 'parameter' cannot be null (use Null=\"allow\" 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((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Parameter = parameter;
}
public ParameterSymbol Parameter { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitParameterEqualsValue(this);
}
public BoundParameterEqualsValue Update(ParameterSymbol parameter, ImmutableArray locals, BoundExpression value)
{
if (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((object)statement != null, "Field 'statement' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Statement = statement;
}
public BoundStatement Statement { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
protected BoundValuePlaceholderBase(BoundKind kind, SyntaxNode syntax, TypeSymbol type)
: base(kind, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
}
internal sealed partial class BoundDeconstructValuePlaceholder : BoundValuePlaceholderBase
{
public BoundDeconstructValuePlaceholder(SyntaxNode syntax, uint valEscape, TypeSymbol type, bool hasErrors)
: base(BoundKind.DeconstructValuePlaceholder, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ValEscape = valEscape;
}
public uint ValEscape { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDeconstructValuePlaceholder(this.Syntax, this.ValEscape, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundTupleOperandPlaceholder : BoundValuePlaceholderBase
{
public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.TupleOperandPlaceholder, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundTupleOperandPlaceholder(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.TupleOperandPlaceholder, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundTupleOperandPlaceholder(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundAwaitableValuePlaceholder : BoundValuePlaceholderBase
{
public BoundAwaitableValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.AwaitableValuePlaceholder, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundAwaitableValuePlaceholder(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.AwaitableValuePlaceholder, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitAwaitableValuePlaceholder(this);
}
public BoundAwaitableValuePlaceholder Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAwaitableValuePlaceholder(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAwaitableValuePlaceholder(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundDisposableValuePlaceholder : BoundValuePlaceholderBase
{
public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.DisposableValuePlaceholder, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundDisposableValuePlaceholder(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.DisposableValuePlaceholder, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDisposableValuePlaceholder(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDup(this.Syntax, this.RefKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundPassByCopy(this.Syntax, this.Expression, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundBadExpression(this.Syntax, this.ResultKind, this.Symbols, this.ChildBoundNodes, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)finallyBlock != null, "Field 'finallyBlock' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.FinallyBlock = finallyBlock;
}
public BoundBlock FinallyBlock { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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, bool inferredType, BoundTypeExpression boundContainingTypeOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.TypeExpression, syntax, type, hasErrors || boundContainingTypeOpt.HasErrors())
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.AliasOpt = aliasOpt;
this.InferredType = inferredType;
this.BoundContainingTypeOpt = boundContainingTypeOpt;
}
public AliasSymbol AliasOpt { get; }
public bool InferredType { get; }
public BoundTypeExpression BoundContainingTypeOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitTypeExpression(this);
}
public BoundTypeExpression Update(AliasSymbol aliasOpt, bool inferredType, BoundTypeExpression boundContainingTypeOpt, TypeSymbol type)
{
if (aliasOpt != this.AliasOpt || inferredType != this.InferredType || boundContainingTypeOpt != this.BoundContainingTypeOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTypeExpression(this.Syntax, aliasOpt, inferredType, boundContainingTypeOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundTypeExpression(this.Syntax, this.AliasOpt, this.InferredType, this.BoundContainingTypeOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundTypeOrValueExpression : BoundExpression
{
public BoundTypeOrValueExpression(SyntaxNode syntax, BoundTypeOrValueData data, TypeSymbol type, bool hasErrors)
: base(BoundKind.TypeOrValueExpression, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Data = data;
}
public BoundTypeOrValueData Data { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundTypeOrValueExpression(this.Syntax, this.Data, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundNamespaceExpression : BoundExpression
{
public BoundNamespaceExpression(SyntaxNode syntax, NamespaceSymbol namespaceSymbol, AliasSymbol aliasOpt, bool hasErrors)
: base(BoundKind.NamespaceExpression, syntax, null, hasErrors)
{
Debug.Assert((object)namespaceSymbol != null, "Field 'namespaceSymbol' cannot be null (use Null=\"allow\" 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((object)namespaceSymbol != null, "Field 'namespaceSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.NamespaceSymbol = namespaceSymbol;
this.AliasOpt = aliasOpt;
}
public NamespaceSymbol NamespaceSymbol { get; }
public AliasSymbol AliasOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitNamespaceExpression(this);
}
public BoundNamespaceExpression Update(NamespaceSymbol namespaceSymbol, AliasSymbol aliasOpt)
{
if (namespaceSymbol != this.NamespaceSymbol || aliasOpt != this.AliasOpt)
{
var result = new BoundNamespaceExpression(this.Syntax, namespaceSymbol, aliasOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundNamespaceExpression(this.Syntax, this.NamespaceSymbol, this.AliasOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundUnaryOperator : BoundExpression
{
public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue constantValueOpt, MethodSymbol methodOpt, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.UnaryOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.OperatorKind = operatorKind;
this.Operand = operand;
this.ConstantValueOpt = constantValueOpt;
this.MethodOpt = methodOpt;
this._ResultKind = resultKind;
}
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 override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitUnaryOperator(this);
}
public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue constantValueOpt, MethodSymbol methodOpt, LookupResultKind resultKind, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || operand != this.Operand || constantValueOpt != this.ConstantValueOpt || methodOpt != this.MethodOpt || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundUnaryOperator(this.Syntax, operatorKind, operand, constantValueOpt, methodOpt, resultKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundUnaryOperator(this.Syntax, this.OperatorKind, this.Operand, this.ConstantValueOpt, this.MethodOpt, this.ResultKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundIncrementOperator : BoundExpression
{
public BoundIncrementOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol methodOpt, Conversion operandConversion, Conversion resultConversion, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.IncrementOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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;
}
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 override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitIncrementOperator(this);
}
public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol methodOpt, Conversion operandConversion, Conversion resultConversion, LookupResultKind resultKind, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || operand != this.Operand || methodOpt != this.MethodOpt || operandConversion != this.OperandConversion || resultConversion != this.ResultConversion || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundIncrementOperator(this.Syntax, operatorKind, operand, methodOpt, operandConversion, resultConversion, resultKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundIncrementOperator(this.Syntax, this.OperatorKind, this.Operand, this.MethodOpt, this.OperandConversion, this.ResultConversion, this.ResultKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.IsManaged = isManaged;
}
public BoundExpression Operand { get; }
public bool IsManaged { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAddressOfOperator(this.Syntax, this.Operand, this.IsManaged, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
}
public BoundExpression Operand { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundPointerIndirectionOperator(this.Syntax, this.Operand, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)index != null, "Field 'index' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.Index = index;
this.Checked = @checked;
}
public BoundExpression Expression { get; }
public BoundExpression Index { get; }
public bool Checked { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundPointerElementAccess(this.Syntax, this.Expression, this.Index, this.Checked, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.GetTypeFromHandle = getTypeFromHandle;
}
public BoundExpression Operand { get; }
public MethodSymbol GetTypeFromHandle { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitRefTypeOperator(this);
}
public BoundRefTypeOperator Update(BoundExpression operand, MethodSymbol getTypeFromHandle, TypeSymbol type)
{
if (operand != this.Operand || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundRefTypeOperator(this.Syntax, this.Operand, this.GetTypeFromHandle, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
}
public BoundExpression Operand { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundMakeRefOperator(this.Syntax, this.Operand, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundRefValueOperator : BoundExpression
{
public BoundRefValueOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.RefValueOperator, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
}
public BoundExpression Operand { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitRefValueOperator(this);
}
public BoundRefValueOperator Update(BoundExpression operand, TypeSymbol type)
{
if (operand != this.Operand || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundRefValueOperator(this.Syntax, operand, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundRefValueOperator(this.Syntax, this.Operand, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.MethodOpt = methodOpt;
}
public BoundExpression Operand { get; }
public MethodSymbol MethodOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitFromEndIndexExpression(this);
}
public BoundFromEndIndexExpression Update(BoundExpression operand, MethodSymbol methodOpt, TypeSymbol type)
{
if (operand != this.Operand || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundFromEndIndexExpression(this.Syntax, this.Operand, this.MethodOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.LeftOperandOpt = leftOperandOpt;
this.RightOperandOpt = rightOperandOpt;
this.MethodOpt = methodOpt;
}
public BoundExpression LeftOperandOpt { get; }
public BoundExpression RightOperandOpt { get; }
public MethodSymbol MethodOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitRangeExpression(this);
}
public BoundRangeExpression Update(BoundExpression leftOperandOpt, BoundExpression rightOperandOpt, MethodSymbol methodOpt, TypeSymbol type)
{
if (leftOperandOpt != this.LeftOperandOpt || rightOperandOpt != this.RightOperandOpt || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundRangeExpression(this.Syntax, this.LeftOperandOpt, this.RightOperandOpt, this.MethodOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)left != null, "Field 'left' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)right != null, "Field 'right' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Left = left;
this.Right = right;
}
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, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.BinaryOperator, syntax, left, right, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert((object)left != null, "Field 'left' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)right != null, "Field 'right' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.OperatorKind = operatorKind;
this.ConstantValueOpt = constantValueOpt;
this.MethodOpt = methodOpt;
this._ResultKind = resultKind;
}
public BinaryOperatorKind OperatorKind { get; }
public ConstantValue ConstantValueOpt { get; }
public MethodSymbol MethodOpt { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitBinaryOperator(this);
}
public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, ConstantValue constantValueOpt, MethodSymbol methodOpt, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || constantValueOpt != this.ConstantValueOpt || methodOpt != this.MethodOpt || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundBinaryOperator(this.Syntax, operatorKind, constantValueOpt, methodOpt, resultKind, left, right, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundBinaryOperator(this.Syntax, this.OperatorKind, this.ConstantValueOpt, this.MethodOpt, this.ResultKind, this.Left, this.Right, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundTupleBinaryOperator : BoundExpression
{
public BoundTupleBinaryOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, BoundExpression convertedLeft, BoundExpression convertedRight, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.TupleBinaryOperator, syntax, type, hasErrors || left.HasErrors() || right.HasErrors() || convertedLeft.HasErrors() || convertedRight.HasErrors())
{
Debug.Assert((object)left != null, "Field 'left' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)right != null, "Field 'right' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)convertedLeft != null, "Field 'convertedLeft' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)convertedRight != null, "Field 'convertedRight' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)operators != null, "Field 'operators' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Left = left;
this.Right = right;
this.ConvertedLeft = convertedLeft;
this.ConvertedRight = convertedRight;
this.OperatorKind = operatorKind;
this.Operators = operators;
}
public BoundExpression Left { get; }
public BoundExpression Right { get; }
public BoundExpression ConvertedLeft { get; }
public BoundExpression ConvertedRight { get; }
public BinaryOperatorKind OperatorKind { get; }
public TupleBinaryOperatorInfo.Multiple Operators { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitTupleBinaryOperator(this);
}
public BoundTupleBinaryOperator Update(BoundExpression left, BoundExpression right, BoundExpression convertedLeft, BoundExpression convertedRight, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type)
{
if (left != this.Left || right != this.Right || convertedLeft != this.ConvertedLeft || convertedRight != this.ConvertedRight || operatorKind != this.OperatorKind || operators != this.Operators || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTupleBinaryOperator(this.Syntax, left, right, convertedLeft, convertedRight, operatorKind, operators, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundTupleBinaryOperator(this.Syntax, this.Left, this.Right, this.ConvertedLeft, this.ConvertedRight, this.OperatorKind, this.Operators, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundUserDefinedConditionalLogicalOperator : BoundBinaryOperatorBase
{
public BoundUserDefinedConditionalLogicalOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.UserDefinedConditionalLogicalOperator, syntax, left, right, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert((object)logicalOperator != null, "Field 'logicalOperator' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)trueOperator != null, "Field 'trueOperator' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)falseOperator != null, "Field 'falseOperator' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)left != null, "Field 'left' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)right != null, "Field 'right' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.OperatorKind = operatorKind;
this.LogicalOperator = logicalOperator;
this.TrueOperator = trueOperator;
this.FalseOperator = falseOperator;
this._ResultKind = resultKind;
}
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 override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitUserDefinedConditionalLogicalOperator(this);
}
public BoundUserDefinedConditionalLogicalOperator Update(BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type)
{
if (operatorKind != this.OperatorKind || logicalOperator != this.LogicalOperator || trueOperator != this.TrueOperator || falseOperator != this.FalseOperator || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundUserDefinedConditionalLogicalOperator(this.Syntax, operatorKind, logicalOperator, trueOperator, falseOperator, resultKind, left, right, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundUserDefinedConditionalLogicalOperator(this.Syntax, this.OperatorKind, this.LogicalOperator, this.TrueOperator, this.FalseOperator, this.ResultKind, this.Left, this.Right, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundCompoundAssignmentOperator : BoundExpression
{
public BoundCompoundAssignmentOperator(SyntaxNode syntax, BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, Conversion leftConversion, Conversion finalConversion, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.CompoundAssignmentOperator, syntax, type, hasErrors || left.HasErrors() || right.HasErrors())
{
Debug.Assert((object)left != null, "Field 'left' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)right != null, "Field 'right' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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;
}
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 override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitCompoundAssignmentOperator(this);
}
public BoundCompoundAssignmentOperator Update(BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, Conversion leftConversion, Conversion finalConversion, LookupResultKind resultKind, TypeSymbol type)
{
if (@operator != this.Operator || left != this.Left || right != this.Right || leftConversion != this.LeftConversion || finalConversion != this.FinalConversion || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundCompoundAssignmentOperator(this.Syntax, @operator, left, right, leftConversion, finalConversion, resultKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundCompoundAssignmentOperator(this.Syntax, this.Operator, this.Left, this.Right, this.LeftConversion, this.FinalConversion, this.ResultKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)left != null, "Field 'left' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAssignmentOperator(this.Syntax, this.Left, this.Right, this.IsRef, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)left != null, "Field 'left' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)right != null, "Field 'right' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Left = left;
this.Right = right;
this.IsUsed = isUsed;
}
public BoundTupleExpression Left { get; }
public BoundConversion Right { get; }
public bool IsUsed { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDeconstructionAssignmentOperator(this.Syntax, this.Left, this.Right, this.IsUsed, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)leftOperand != null, "Field 'leftOperand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)rightOperand != null, "Field 'rightOperand' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundNullCoalescingOperator(this.Syntax, this.LeftOperand, this.RightOperand, this.LeftConversion, this.OperatorResultKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)leftOperand != null, "Field 'leftOperand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)rightOperand != null, "Field 'rightOperand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.LeftOperand = leftOperand;
this.RightOperand = rightOperand;
}
public BoundExpression LeftOperand { get; }
public BoundExpression RightOperand { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundNullCoalescingAssignmentOperator(this.Syntax, this.LeftOperand, this.RightOperand, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)condition != null, "Field 'condition' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)consequence != null, "Field 'consequence' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)alternative != null, "Field 'alternative' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.IsRef = isRef;
this.Condition = condition;
this.Consequence = consequence;
this.Alternative = alternative;
this.ConstantValueOpt = constantValueOpt;
}
public bool IsRef { get; }
public BoundExpression Condition { get; }
public BoundExpression Consequence { get; }
public BoundExpression Alternative { get; }
public ConstantValue ConstantValueOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundConditionalOperator(this.Syntax, this.IsRef, this.Condition, this.Consequence, this.Alternative, this.ConstantValueOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.Indices = indices;
}
public BoundExpression Expression { get; }
public ImmutableArray Indices { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundArrayAccess(this.Syntax, this.Expression, this.Indices, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundArrayLength(this.Syntax, this.Expression, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundAwaitExpression : BoundExpression
{
public BoundAwaitExpression(SyntaxNode syntax, BoundExpression expression, AwaitableInfo awaitableInfo, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.AwaitExpression, syntax, type, hasErrors || expression.HasErrors())
{
Debug.Assert((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)awaitableInfo != null, "Field 'awaitableInfo' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
this.AwaitableInfo = awaitableInfo;
}
public BoundExpression Expression { get; }
public AwaitableInfo AwaitableInfo { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitAwaitExpression(this);
}
public BoundAwaitExpression Update(BoundExpression expression, AwaitableInfo 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAwaitExpression(this.Syntax, this.Expression, this.AwaitableInfo, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.GetTypeFromHandle = getTypeFromHandle;
}
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((object)sourceType != null, "Field 'sourceType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.SourceType = sourceType;
}
public BoundTypeExpression SourceType { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitTypeOfOperator(this);
}
public BoundTypeOfOperator Update(BoundTypeExpression sourceType, MethodSymbol getTypeFromHandle, TypeSymbol type)
{
if (sourceType != this.SourceType || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundTypeOfOperator(this.Syntax, this.SourceType, this.GetTypeFromHandle, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundMethodDefIndex : BoundExpression
{
public BoundMethodDefIndex(SyntaxNode syntax, MethodSymbol method, TypeSymbol type, bool hasErrors)
: base(BoundKind.MethodDefIndex, syntax, type, hasErrors)
{
Debug.Assert((object)method != null, "Field 'method' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)method != null, "Field 'method' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Method = method;
}
public MethodSymbol Method { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitMethodDefIndex(this);
}
public BoundMethodDefIndex Update(MethodSymbol method, TypeSymbol type)
{
if (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundMethodDefIndex(this.Syntax, this.Method, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundMaximumMethodDefIndex : BoundExpression
{
public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.MaximumMethodDefIndex, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundMaximumMethodDefIndex(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.MaximumMethodDefIndex, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundMaximumMethodDefIndex(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundInstrumentationPayloadRoot : BoundExpression
{
public BoundInstrumentationPayloadRoot(SyntaxNode syntax, int analysisKind, TypeSymbol type, bool hasErrors)
: base(BoundKind.InstrumentationPayloadRoot, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.AnalysisKind = analysisKind;
}
public int AnalysisKind { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundInstrumentationPayloadRoot(this.Syntax, this.AnalysisKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundModuleVersionId : BoundExpression
{
public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ModuleVersionId, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundModuleVersionId(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ModuleVersionId, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundModuleVersionId(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundModuleVersionIdString : BoundExpression
{
public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ModuleVersionIdString, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundModuleVersionIdString(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ModuleVersionIdString, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundModuleVersionIdString(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)document != null, "Field 'document' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)document != null, "Field 'document' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Document = document;
}
public Cci.DebugSourceDocument Document { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundSourceDocumentIndex(this.Syntax, this.Document, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)method != null, "Field 'method' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)method != null, "Field 'method' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Method = method;
this.GetMethodFromHandle = getMethodFromHandle;
}
public MethodSymbol Method { get; }
public MethodSymbol GetMethodFromHandle { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitMethodInfo(this);
}
public BoundMethodInfo Update(MethodSymbol method, MethodSymbol getMethodFromHandle, TypeSymbol type)
{
if (method != this.Method || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundMethodInfo(this.Syntax, this.Method, this.GetMethodFromHandle, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)field != null, "Field 'field' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)field != null, "Field 'field' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Field = field;
this.GetFieldFromHandle = getFieldFromHandle;
}
public FieldSymbol Field { get; }
public MethodSymbol GetFieldFromHandle { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitFieldInfo(this);
}
public BoundFieldInfo Update(FieldSymbol field, MethodSymbol getFieldFromHandle, TypeSymbol type)
{
if (field != this.Field || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundFieldInfo(this.Syntax, this.Field, this.GetFieldFromHandle, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundDefaultExpression : BoundExpression
{
public BoundDefaultExpression(SyntaxNode syntax, ConstantValue constantValueOpt, TypeSymbol type, bool hasErrors)
: base(BoundKind.DefaultExpression, syntax, type, hasErrors)
{
this.ConstantValueOpt = constantValueOpt;
}
public BoundDefaultExpression(SyntaxNode syntax, ConstantValue constantValueOpt, TypeSymbol type)
: base(BoundKind.DefaultExpression, syntax, type)
{
this.ConstantValueOpt = constantValueOpt;
}
public ConstantValue ConstantValueOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDefaultExpression(this);
}
public BoundDefaultExpression Update(ConstantValue constantValueOpt, TypeSymbol type)
{
if (constantValueOpt != this.ConstantValueOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDefaultExpression(this.Syntax, constantValueOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDefaultExpression(this.Syntax, this.ConstantValueOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)targetType != null, "Field 'targetType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.TargetType = targetType;
this.Conversion = conversion;
}
public BoundExpression Operand { get; }
public BoundTypeExpression TargetType { get; }
public Conversion Conversion { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundIsOperator(this.Syntax, this.Operand, this.TargetType, this.Conversion, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)targetType != null, "Field 'targetType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Operand = operand;
this.TargetType = targetType;
this.Conversion = conversion;
}
public BoundExpression Operand { get; }
public BoundTypeExpression TargetType { get; }
public Conversion Conversion { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAsOperator(this.Syntax, this.Operand, this.TargetType, this.Conversion, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)sourceType != null, "Field 'sourceType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.SourceType = sourceType;
this.ConstantValueOpt = constantValueOpt;
}
public BoundTypeExpression SourceType { get; }
public ConstantValue ConstantValueOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundSizeOfOperator(this.Syntax, this.SourceType, this.ConstantValueOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundConversion : BoundExpression
{
public BoundConversion(SyntaxNode syntax, BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue constantValueOpt, ConversionGroup conversionGroupOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.Conversion, syntax, type, hasErrors || operand.HasErrors())
{
Debug.Assert((object)operand != null, "Field 'operand' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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;
}
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 override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitConversion(this);
}
public BoundConversion Update(BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue constantValueOpt, ConversionGroup conversionGroupOpt, TypeSymbol type)
{
if (operand != this.Operand || conversion != this.Conversion || isBaseConversion != this.IsBaseConversion || @checked != this.Checked || explicitCastInCode != this.ExplicitCastInCode || constantValueOpt != this.ConstantValueOpt || conversionGroupOpt != this.ConversionGroupOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConversion(this.Syntax, operand, conversion, isBaseConversion, @checked, explicitCastInCode, constantValueOpt, conversionGroupOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundConversion(this.Syntax, this.Operand, this.Conversion, this.IsBaseConversion, this.Checked, this.ExplicitCastInCode, this.ConstantValueOpt, this.ConversionGroupOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundArgList : BoundExpression
{
public BoundArgList(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ArgList, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundArgList(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ArgList, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundArgList(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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 ImmutableArray Arguments { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundArgListOperator(this.Syntax, this.Arguments, this.ArgumentRefKindsOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)elementPointerType != null, "Field 'elementPointerType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ElementPointerType = elementPointerType;
this.ElementPointerTypeConversion = elementPointerTypeConversion;
this.Expression = expression;
this.GetPinnableOpt = getPinnableOpt;
}
public TypeSymbol ElementPointerType { get; }
public Conversion ElementPointerTypeConversion { get; }
public BoundExpression Expression { get; }
public MethodSymbol GetPinnableOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundFixedLocalCollectionInitializer(this.Syntax, this.ElementPointerType, this.ElementPointerTypeConversion, this.Expression, this.GetPinnableOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)statement != null, "Field 'statement' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Fields = fields;
this.Statement = statement;
}
public ImmutableArray Fields { get; }
public BoundStatement Statement { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 declaredType, BoundExpression initializerOpt, ImmutableArray argumentsOpt, bool hasErrors = false)
: base(BoundKind.LocalDeclaration, syntax, hasErrors || declaredType.HasErrors() || initializerOpt.HasErrors() || argumentsOpt.HasErrors())
{
Debug.Assert((object)localSymbol != null, "Field 'localSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)declaredType != null, "Field 'declaredType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.DeclaredType = declaredType;
this.InitializerOpt = initializerOpt;
this.ArgumentsOpt = argumentsOpt;
}
public LocalSymbol LocalSymbol { get; }
public BoundTypeExpression DeclaredType { get; }
public BoundExpression InitializerOpt { get; }
public ImmutableArray ArgumentsOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLocalDeclaration(this);
}
public BoundLocalDeclaration Update(LocalSymbol localSymbol, BoundTypeExpression declaredType, BoundExpression initializerOpt, ImmutableArray argumentsOpt)
{
if (localSymbol != this.LocalSymbol || declaredType != this.DeclaredType || initializerOpt != this.InitializerOpt || argumentsOpt != this.ArgumentsOpt)
{
var result = new BoundLocalDeclaration(this.Syntax, localSymbol, declaredType, initializerOpt, argumentsOpt, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal partial class BoundMultipleLocalDeclarations : BoundStatement
{
protected BoundMultipleLocalDeclarations(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 BoundMultipleLocalDeclarations(SyntaxNode syntax, ImmutableArray localDeclarations, bool hasErrors = false)
: base(BoundKind.MultipleLocalDeclarations, syntax, hasErrors || localDeclarations.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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 : BoundMultipleLocalDeclarations
{
public BoundUsingLocalDeclarations(SyntaxNode syntax, MethodSymbol disposeMethodOpt, Conversion iDisposableConversion, AwaitableInfo awaitOpt, ImmutableArray localDeclarations, bool hasErrors = false)
: base(BoundKind.UsingLocalDeclarations, syntax, localDeclarations, 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 AwaitableInfo AwaitOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitUsingLocalDeclarations(this);
}
public BoundUsingLocalDeclarations Update(MethodSymbol disposeMethodOpt, Conversion iDisposableConversion, AwaitableInfo awaitOpt, ImmutableArray localDeclarations)
{
if (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((object)symbol != null, "Field 'symbol' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLocalFunctionStatement(this);
}
public BoundLocalFunctionStatement Update(LocalFunctionSymbol symbol, BoundBlock blockBody, BoundBlock expressionBody)
{
if (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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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)
{
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundBreakStatement(SyntaxNode syntax, GeneratedLabelSymbol label)
: base(BoundKind.BreakStatement, syntax)
{
Debug.Assert((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public GeneratedLabelSymbol Label { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitBreakStatement(this);
}
public BoundBreakStatement Update(GeneratedLabelSymbol label)
{
if (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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundContinueStatement(SyntaxNode syntax, GeneratedLabelSymbol label)
: base(BoundKind.ContinueStatement, syntax)
{
Debug.Assert((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public GeneratedLabelSymbol Label { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitContinueStatement(this);
}
public BoundContinueStatement Update(GeneratedLabelSymbol label)
{
if (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((object)expression != null, "Field 'expression' 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(!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((object)decisionDag != null, "Field 'decisionDag' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || 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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" 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((object)defaultLabel != null, "Field 'defaultLabel' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || defaultLabel != this.DefaultLabel || 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((object)condition != null, "Field 'condition' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)consequence != null, "Field 'consequence' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)continueLabel != null, "Field 'continueLabel' cannot be null (use Null=\"allow\" 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((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)continueLabel != null, "Field 'continueLabel' cannot be null (use Null=\"allow\" 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((object)condition != null, "Field 'condition' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)continueLabel != null, "Field 'continueLabel' cannot be null (use Null=\"allow\" 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((object)condition != null, "Field 'condition' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)continueLabel != null, "Field 'continueLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || breakLabel != this.BreakLabel || 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((object)condition != null, "Field 'condition' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)continueLabel != null, "Field 'continueLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || breakLabel != this.BreakLabel || 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((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)continueLabel != null, "Field 'continueLabel' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || breakLabel != this.BreakLabel || 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, AwaitableInfo 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() || body.HasErrors())
{
Debug.Assert((object)iterationVariableType != null, "Field 'iterationVariableType' cannot be null (use Null=\"allow\" 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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)breakLabel != null, "Field 'breakLabel' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)continueLabel != null, "Field 'continueLabel' cannot be null (use Null=\"allow\" 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 AwaitableInfo AwaitOpt { get; }
public BoundStatement Body { get; }
public bool Checked { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitForEachStatement(this);
}
public BoundForEachStatement Update(ForEachEnumeratorInfo enumeratorInfoOpt, Conversion elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray iterationVariables, BoundExpression iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep deconstructionOpt, AwaitableInfo 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 || breakLabel != this.BreakLabel || 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((object)deconstructionAssignment != null, "Field 'deconstructionAssignment' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)targetPlaceholder != null, "Field 'targetPlaceholder' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.DeconstructionAssignment = deconstructionAssignment;
this.TargetPlaceholder = targetPlaceholder;
}
public BoundDeconstructionAssignmentOperator DeconstructionAssignment { get; }
public BoundDeconstructValuePlaceholder TargetPlaceholder { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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, AwaitableInfo awaitOpt, MethodSymbol disposeMethodOpt, bool hasErrors = false)
: base(BoundKind.UsingStatement, syntax, hasErrors || declarationsOpt.HasErrors() || expressionOpt.HasErrors() || body.HasErrors())
{
Debug.Assert(!locals.IsDefault, "Field 'locals' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" 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 AwaitableInfo AwaitOpt { get; }
public MethodSymbol DisposeMethodOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitUsingStatement(this);
}
public BoundUsingStatement Update(ImmutableArray locals, BoundMultipleLocalDeclarations declarationsOpt, BoundExpression expressionOpt, Conversion iDisposableConversion, BoundStatement body, AwaitableInfo awaitOpt, MethodSymbol disposeMethodOpt)
{
if (locals != this.Locals || declarationsOpt != this.DeclarationsOpt || expressionOpt != this.ExpressionOpt || iDisposableConversion != this.IDisposableConversion || body != this.Body || awaitOpt != this.AwaitOpt || 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((object)declarations != null, "Field 'declarations' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)argument != null, "Field 'argument' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Argument = argument;
this.Body = body;
}
public BoundExpression Argument { get; }
public BoundStatement Body { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)tryBlock != null, "Field 'tryBlock' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || 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((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundLiteral(this.Syntax, this.ConstantValueOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundThisReference : BoundExpression
{
public BoundThisReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ThisReference, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundThisReference(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ThisReference, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundThisReference(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundPreviousSubmissionReference : BoundExpression
{
public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.PreviousSubmissionReference, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundPreviousSubmissionReference(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.PreviousSubmissionReference, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundPreviousSubmissionReference(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundHostObjectMemberReference : BoundExpression
{
public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.HostObjectMemberReference, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundHostObjectMemberReference(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.HostObjectMemberReference, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundHostObjectMemberReference(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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 override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundBaseReference(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)localSymbol != null, "Field 'localSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)localSymbol != null, "Field 'localSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.DeclarationKind = declarationKind;
this.ConstantValueOpt = constantValueOpt;
this.IsNullableUnknown = isNullableUnknown;
}
public LocalSymbol LocalSymbol { get; }
public BoundLocalDeclarationKind DeclarationKind { get; }
public ConstantValue ConstantValueOpt { get; }
public bool IsNullableUnknown { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLocal(this);
}
public BoundLocal Update(LocalSymbol localSymbol, BoundLocalDeclarationKind declarationKind, ConstantValue constantValueOpt, bool isNullableUnknown, TypeSymbol type)
{
if (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundLocal(this.Syntax, this.LocalSymbol, this.DeclarationKind, this.ConstantValueOpt, this.IsNullableUnknown, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)localSymbol != null, "Field 'localSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)emitExpressions != null, "Field 'emitExpressions' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)localSymbol != null, "Field 'localSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)emitExpressions != null, "Field 'emitExpressions' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.LocalSymbol = localSymbol;
this.EmitExpressions = emitExpressions;
}
public LocalSymbol LocalSymbol { get; }
public PseudoVariableExpressions EmitExpressions { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitPseudoVariable(this);
}
public BoundPseudoVariable Update(LocalSymbol localSymbol, PseudoVariableExpressions emitExpressions, TypeSymbol type)
{
if (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundPseudoVariable(this.Syntax, this.LocalSymbol, this.EmitExpressions, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)rangeVariableSymbol != null, "Field 'rangeVariableSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.RangeVariableSymbol = rangeVariableSymbol;
this.Value = value;
}
public RangeVariableSymbol RangeVariableSymbol { get; }
public BoundExpression Value { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitRangeVariable(this);
}
public BoundRangeVariable Update(RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type)
{
if (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundRangeVariable(this.Syntax, this.RangeVariableSymbol, this.Value, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundParameter : BoundExpression
{
public BoundParameter(SyntaxNode syntax, ParameterSymbol parameterSymbol, TypeSymbol type, bool hasErrors)
: base(BoundKind.Parameter, syntax, type, hasErrors)
{
Debug.Assert((object)parameterSymbol != null, "Field 'parameterSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)parameterSymbol != null, "Field 'parameterSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ParameterSymbol = parameterSymbol;
}
public ParameterSymbol ParameterSymbol { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitParameter(this);
}
public BoundParameter Update(ParameterSymbol parameterSymbol, TypeSymbol type)
{
if (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundParameter(this.Syntax, this.ParameterSymbol, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundLabelStatement : BoundStatement
{
public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors)
: base(BoundKind.LabelStatement, syntax, hasErrors)
{
Debug.Assert((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label)
: base(BoundKind.LabelStatement, syntax)
{
Debug.Assert((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public LabelSymbol Label { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLabelStatement(this);
}
public BoundLabelStatement Update(LabelSymbol label)
{
if (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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitGotoStatement(this);
}
public BoundGotoStatement Update(LabelSymbol label, BoundExpression caseExpressionOpt, BoundLabel labelExpressionOpt)
{
if (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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)body != null, "Field 'body' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
this.Body = body;
}
public LabelSymbol Label { get; }
public BoundStatement Body { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLabeledStatement(this);
}
public BoundLabeledStatement Update(LabelSymbol label, BoundStatement body)
{
if (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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" 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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public LabelSymbol Label { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLabel(this);
}
public BoundLabel Update(LabelSymbol label, TypeSymbol type)
{
if (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundLabel(this.Syntax, this.Label, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)condition != null, "Field 'condition' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitConditionalGoto(this);
}
public BoundConditionalGoto Update(BoundExpression condition, bool jumpIfTrue, LabelSymbol label)
{
if (condition != this.Condition || jumpIfTrue != this.JumpIfTrue || label != this.Label)
{
var result = new BoundConditionalGoto(this.Syntax, condition, jumpIfTrue, label, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
}
internal sealed partial class BoundSwitchExpression : BoundExpression
{
public BoundSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray switchArms, BoundDecisionDag decisionDag, LabelSymbol defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.SwitchExpression, syntax, type, hasErrors || expression.HasErrors() || switchArms.HasErrors() || decisionDag.HasErrors())
{
Debug.Assert((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" 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((object)decisionDag != null, "Field 'decisionDag' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitSwitchExpression(this);
}
public BoundSwitchExpression Update(BoundExpression expression, ImmutableArray switchArms, BoundDecisionDag decisionDag, LabelSymbol defaultLabel, bool reportedNotExhaustive, TypeSymbol type)
{
if (expression != this.Expression || switchArms != this.SwitchArms || decisionDag != this.DecisionDag || defaultLabel != this.DefaultLabel || reportedNotExhaustive != this.ReportedNotExhaustive || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundSwitchExpression(this.Syntax, expression, switchArms, decisionDag, defaultLabel, reportedNotExhaustive, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundSwitchExpression(this.Syntax, this.Expression, this.SwitchArms, this.DecisionDag, this.DefaultLabel, this.ReportedNotExhaustive, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)pattern != null, "Field 'pattern' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || 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 BoundDecisionDag : BoundNode
{
public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode, bool hasErrors)
: base(BoundKind.DecisionDag, syntax, hasErrors)
{
Debug.Assert((object)rootNode != null, "Field 'rootNode' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.RootNode = rootNode;
}
public BoundDecisionDag(SyntaxNode syntax, BoundDecisionDagNode rootNode)
: base(BoundKind.DecisionDag, syntax)
{
Debug.Assert((object)rootNode != null, "Field 'rootNode' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.RootNode = rootNode;
}
public BoundDecisionDagNode RootNode { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)evaluation != null, "Field 'evaluation' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)next != null, "Field 'next' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Evaluation = evaluation;
this.Next = next;
}
public BoundDagEvaluation Evaluation { get; }
public BoundDecisionDagNode Next { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)test != null, "Field 'test' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)whenTrue != null, "Field 'whenTrue' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)whenFalse != null, "Field 'whenFalse' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)whenTrue != null, "Field 'whenTrue' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label)
: base(BoundKind.LeafDecisionDagNode, syntax)
{
Debug.Assert((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Label = label;
}
public LabelSymbol Label { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLeafDecisionDagNode(this);
}
public BoundLeafDecisionDagNode Update(LabelSymbol label)
{
if (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((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Type = type;
}
public TypeSymbol Type { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 BoundDagNullTest : BoundDagTest
{
public BoundDagNullTest(SyntaxNode syntax, BoundDagTemp input, bool hasErrors = false)
: base(BoundKind.DagNullTest, syntax, input, hasErrors || input.HasErrors())
{
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDagNullTest(this);
}
public BoundDagNullTest Update(BoundDagTemp input)
{
if (input != this.Input)
{
var result = new BoundDagNullTest(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((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Value = value;
}
public ConstantValue Value { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" 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((object)deconstructMethod != null, "Field 'deconstructMethod' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.DeconstructMethod = deconstructMethod;
}
public MethodSymbol DeconstructMethod { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDagDeconstructEvaluation(this);
}
public BoundDagDeconstructEvaluation Update(MethodSymbol deconstructMethod, BoundDagTemp input)
{
if (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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Type = type;
}
public TypeSymbol Type { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)field != null, "Field 'field' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Field = field;
}
public FieldSymbol Field { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDagFieldEvaluation(this);
}
public BoundDagFieldEvaluation Update(FieldSymbol field, BoundDagTemp input)
{
if (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((object)property != null, "Field 'property' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Property = property;
}
public PropertySymbol Property { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDagPropertyEvaluation(this);
}
public BoundDagPropertyEvaluation Update(PropertySymbol property, BoundDagTemp input)
{
if (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((object)property != null, "Field 'property' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)input != null, "Field 'input' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Property = property;
this.Index = index;
}
public PropertySymbol Property { get; }
public int Index { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDagIndexEvaluation(this);
}
public BoundDagIndexEvaluation Update(PropertySymbol property, int index, BoundDagTemp input)
{
if (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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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((object)label != null, "Field 'label' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)pattern != null, "Field 'pattern' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitSwitchLabel(this);
}
public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, BoundExpression whenClause)
{
if (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 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((object)expression != null, "Field 'expression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Expression = expression;
}
public BoundExpression Expression { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundSequencePointExpression(this.Syntax, this.Expression, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.SideEffects = sideEffects;
this.Value = value;
}
public ImmutableArray Locals { get; }
public ImmutableArray SideEffects { get; }
public BoundExpression Value { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundSequence(this.Syntax, this.Locals, this.SideEffects, this.Value, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)value != null, "Field 'value' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Locals = locals;
this.SideEffects = sideEffects;
this.Value = value;
}
public ImmutableArray Locals { get; }
public ImmutableArray SideEffects { get; }
public BoundExpression Value { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundSpillSequence(this.Syntax, this.Locals, this.SideEffects, this.Value, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)receiver != null, "Field 'receiver' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)name != null, "Field 'name' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Receiver = receiver;
this.TypeArgumentsOpt = typeArgumentsOpt;
this.Name = name;
this.Invoked = invoked;
this.Indexed = indexed;
}
public BoundExpression Receiver { get; }
public ImmutableArray TypeArgumentsOpt { get; }
public string Name { get; }
public bool Invoked { get; }
public bool Indexed { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDynamicMemberAccess(this.Syntax, this.Receiver, this.TypeArgumentsOpt, this.Name, this.Invoked, this.Indexed, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)expression != null, "Field 'expression' 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)");
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((object)expression != null, "Field 'expression' 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ArgumentNamesOpt = argumentNamesOpt;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
this.ApplicableMethods = applicableMethods;
}
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public ImmutableArray ApplicableMethods { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDynamicInvocation(this.Syntax, this.ArgumentNamesOpt, this.ArgumentRefKindsOpt, this.ApplicableMethods, this.Expression, this.Arguments, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)receiver != null, "Field 'receiver' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)accessExpression != null, "Field 'accessExpression' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Receiver = receiver;
this.AccessExpression = accessExpression;
}
public BoundExpression Receiver { get; }
public BoundExpression AccessExpression { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundConditionalAccess(this.Syntax, this.Receiver, this.AccessExpression, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)receiver != null, "Field 'receiver' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)whenNotNull != null, "Field 'whenNotNull' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Receiver = receiver;
this.HasValueMethodOpt = hasValueMethodOpt;
this.WhenNotNull = whenNotNull;
this.WhenNullOpt = whenNullOpt;
this.Id = id;
}
public BoundExpression Receiver { get; }
public MethodSymbol HasValueMethodOpt { get; }
public BoundExpression WhenNotNull { get; }
public BoundExpression WhenNullOpt { get; }
public int Id { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitLoweredConditionalAccess(this);
}
public BoundLoweredConditionalAccess Update(BoundExpression receiver, MethodSymbol hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression whenNullOpt, int id, TypeSymbol type)
{
if (receiver != this.Receiver || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundLoweredConditionalAccess(this.Syntax, this.Receiver, this.HasValueMethodOpt, this.WhenNotNull, this.WhenNullOpt, this.Id, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundConditionalReceiver : BoundExpression
{
public BoundConditionalReceiver(SyntaxNode syntax, int id, TypeSymbol type, bool hasErrors)
: base(BoundKind.ConditionalReceiver, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Id = id;
}
public int Id { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundConditionalReceiver(this.Syntax, this.Id, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)valueTypeReceiver != null, "Field 'valueTypeReceiver' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)referenceTypeReceiver != null, "Field 'referenceTypeReceiver' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ValueTypeReceiver = valueTypeReceiver;
this.ReferenceTypeReceiver = referenceTypeReceiver;
}
public BoundExpression ValueTypeReceiver { get; }
public BoundExpression ReferenceTypeReceiver { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundComplexConditionalReceiver(this.Syntax, this.ValueTypeReceiver, this.ReferenceTypeReceiver, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)name != null, "Field 'name' cannot be null (use Null=\"allow\" 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 || 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundMethodGroup(this.Syntax, this.TypeArgumentsOpt, this.Name, this.Methods, this.LookupSymbolOpt, this.LookupError, this.Flags, this.ReceiverOpt, this.ResultKind, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundPropertyGroup(this.Syntax, this.Properties, this.ReceiverOpt, this.ResultKind, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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, Binder binderOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.Call, syntax, type, hasErrors || receiverOpt.HasErrors() || arguments.HasErrors())
{
Debug.Assert((object)method != null, "Field 'method' 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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.BinderOpt = binderOpt;
}
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 Binder BinderOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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, Binder binderOpt, TypeSymbol type)
{
if (receiverOpt != this.ReceiverOpt || 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 || 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, binderOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundCall(this.Syntax, this.ReceiverOpt, this.Method, this.Arguments, this.ArgumentNamesOpt, this.ArgumentRefKindsOpt, this.IsDelegateCall, this.Expanded, this.InvokedAsExtensionMethod, this.ArgsToParamsOpt, this.ResultKind, this.BinderOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)@event != null, "Field '@event' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)argument != null, "Field 'argument' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Event = @event;
this.IsAddition = isAddition;
this.IsDynamic = isDynamic;
this.ReceiverOpt = receiverOpt;
this.Argument = argument;
}
public EventSymbol Event { get; }
public bool IsAddition { get; }
public bool IsDynamic { get; }
public BoundExpression ReceiverOpt { get; }
public BoundExpression Argument { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitEventAssignmentOperator(this);
}
public BoundEventAssignmentOperator Update(EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression receiverOpt, BoundExpression argument, TypeSymbol type)
{
if (@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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundEventAssignmentOperator(this.Syntax, this.Event, this.IsAddition, this.IsDynamic, this.ReceiverOpt, this.Argument, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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 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;} }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitAttribute(this);
}
public BoundAttribute Update(MethodSymbol constructor, ImmutableArray constructorArguments, ImmutableArray constructorArgumentNamesOpt, ImmutableArray constructorArgumentsToParamsOpt, bool constructorExpanded, ImmutableArray namedArguments, LookupResultKind resultKind, TypeSymbol type)
{
if (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAttribute(this.Syntax, this.Constructor, this.ConstructorArguments, this.ConstructorArgumentNamesOpt, this.ConstructorArgumentsToParamsOpt, this.ConstructorExpanded, this.NamedArguments, this.ResultKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)constructor != null, "Field 'constructor' cannot be null (use Null=\"allow\" 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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 (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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundObjectCreationExpression(this.Syntax, this.Constructor, this.ConstructorsGroup, this.Arguments, this.ArgumentNamesOpt, this.ArgumentRefKindsOpt, this.Expanded, this.ArgsToParamsOpt, this.ConstantValueOpt, this.InitializerExpressionOpt, this.BinderOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal abstract partial class BoundTupleExpression : BoundExpression
{
protected BoundTupleExpression(BoundKind kind, SyntaxNode syntax, ImmutableArray arguments, 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;
}
public ImmutableArray Arguments { get; }
}
internal sealed partial class BoundTupleLiteral : BoundTupleExpression
{
public BoundTupleLiteral(SyntaxNode syntax, ImmutableArray argumentNamesOpt, ImmutableArray inferredNamesOpt, ImmutableArray arguments, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.TupleLiteral, syntax, arguments, type, hasErrors || arguments.HasErrors())
{
Debug.Assert(!arguments.IsDefault, "Field 'arguments' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ArgumentNamesOpt = argumentNamesOpt;
this.InferredNamesOpt = inferredNamesOpt;
}
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray InferredNamesOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitTupleLiteral(this);
}
public BoundTupleLiteral Update(ImmutableArray argumentNamesOpt, ImmutableArray inferredNamesOpt, ImmutableArray arguments, TypeSymbol type)
{
if (argumentNamesOpt != this.ArgumentNamesOpt || inferredNamesOpt != this.InferredNamesOpt || arguments != this.Arguments || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundTupleLiteral(this.Syntax, argumentNamesOpt, inferredNamesOpt, arguments, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundTupleLiteral(this.Syntax, this.ArgumentNamesOpt, this.InferredNamesOpt, this.Arguments, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundConvertedTupleLiteral : BoundTupleExpression
{
public BoundConvertedTupleLiteral(SyntaxNode syntax, TypeSymbol naturalTypeOpt, ImmutableArray arguments, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ConvertedTupleLiteral, syntax, arguments, 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.NaturalTypeOpt = naturalTypeOpt;
}
public TypeSymbol NaturalTypeOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitConvertedTupleLiteral(this);
}
public BoundConvertedTupleLiteral Update(TypeSymbol naturalTypeOpt, ImmutableArray arguments, TypeSymbol type)
{
if (!TypeSymbol.Equals(naturalTypeOpt, this.NaturalTypeOpt, TypeCompareKind.ConsiderEverything) || arguments != this.Arguments || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConvertedTupleLiteral(this.Syntax, naturalTypeOpt, arguments, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundConvertedTupleLiteral(this.Syntax, this.NaturalTypeOpt, this.Arguments, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)name != null, "Field 'name' 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(!applicableMethods.IsDefault, "Field 'applicableMethods' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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 string Name { get; }
public ImmutableArray Arguments { get; }
public ImmutableArray ArgumentNamesOpt { get; }
public ImmutableArray ArgumentRefKindsOpt { get; }
public BoundObjectInitializerExpressionBase InitializerExpressionOpt { get; }
public ImmutableArray ApplicableMethods { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDynamicObjectCreationExpression(this.Syntax, this.Name, this.Arguments, this.ArgumentNamesOpt, this.ArgumentRefKindsOpt, this.InitializerExpressionOpt, this.ApplicableMethods, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.GuidString = guidString;
this.InitializerExpressionOpt = initializerExpressionOpt;
}
public string GuidString { get; }
public BoundObjectInitializerExpressionBase InitializerExpressionOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return 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;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundNoPiaObjectCreationExpression(this.Syntax, this.GuidString, this.InitializerExpressionOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal abstract partial class BoundObjectInitializerExpressionBase : BoundExpression
{
protected BoundObjectInitializerExpressionBase(BoundKind kind, SyntaxNode syntax, ImmutableArray initializers, TypeSymbol type, bool hasErrors = false)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert(!initializers.IsDefault, "Field 'initializers' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Initializers = initializers;
}
public ImmutableArray Initializers { get; }
}
internal sealed partial class BoundObjectInitializerExpression : BoundObjectInitializerExpressionBase
{
public BoundObjectInitializerExpression(SyntaxNode syntax, ImmutableArray initializers, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ObjectInitializerExpression, syntax, initializers, type, hasErrors || initializers.HasErrors())
{
Debug.Assert(!initializers.IsDefault, "Field 'initializers' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitObjectInitializerExpression(this);
}
public BoundObjectInitializerExpression Update(ImmutableArray initializers, TypeSymbol type)
{
if (initializers != this.Initializers || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundObjectInitializerExpression(this.Syntax, initializers, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundObjectInitializerExpression(this.Syntax, this.Initializers, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
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((object)receiverType != null, "Field 'receiverType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" 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 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; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitObjectInitializerMember(this);
}
public BoundObjectInitializerMember Update(Symbol memberSymbol, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool expanded, ImmutableArray argsToParamsOpt, LookupResultKind resultKind, TypeSymbol receiverType, Binder binderOpt, TypeSymbol type)
{
if (memberSymbol != this.MemberSymbol || arguments != this.Arguments || argumentNamesOpt != this.ArgumentNamesOpt || argumentRefKindsOpt != this.ArgumentRefKindsOpt || expanded != this.Expanded || argsToParamsOpt != this.ArgsToParamsOpt || resultKind != this.ResultKind || !TypeSymbol.Equals(receiverType, this.ReceiverType, TypeCompareKind.ConsiderEverything) || binderOpt != this.BinderOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundObjectInitializerMember(this.Syntax, memberSymbol, arguments, argumentNamesOpt, argumentRefKindsOpt, expanded, argsToParamsOpt, resultKind, receiverType, binderOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundObjectInitializerMember(this.Syntax, this.MemberSymbol, this.Arguments, this.ArgumentNamesOpt, this.ArgumentRefKindsOpt, this.Expanded, this.ArgsToParamsOpt, this.ResultKind, this.ReceiverType, this.BinderOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundDynamicObjectInitializerMember : BoundExpression
{
public BoundDynamicObjectInitializerMember(SyntaxNode syntax, string memberName, TypeSymbol receiverType, TypeSymbol type, bool hasErrors)
: base(BoundKind.DynamicObjectInitializerMember, syntax, type, hasErrors)
{
Debug.Assert((object)memberName != null, "Field 'memberName' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)receiverType != null, "Field 'receiverType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.MemberName = memberName;
this.ReceiverType = receiverType;
}
public BoundDynamicObjectInitializerMember(SyntaxNode syntax, string memberName, TypeSymbol receiverType, TypeSymbol type)
: base(BoundKind.DynamicObjectInitializerMember, syntax, type)
{
Debug.Assert((object)memberName != null, "Field 'memberName' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)receiverType != null, "Field 'receiverType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.MemberName = memberName;
this.ReceiverType = receiverType;
}
public string MemberName { get; }
public TypeSymbol ReceiverType { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDynamicObjectInitializerMember(this);
}
public BoundDynamicObjectInitializerMember Update(string memberName, TypeSymbol receiverType, TypeSymbol type)
{
if (memberName != this.MemberName || !TypeSymbol.Equals(receiverType, this.ReceiverType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDynamicObjectInitializerMember(this.Syntax, memberName, receiverType, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDynamicObjectInitializerMember(this.Syntax, this.MemberName, this.ReceiverType, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundCollectionInitializerExpression : BoundObjectInitializerExpressionBase
{
public BoundCollectionInitializerExpression(SyntaxNode syntax, ImmutableArray initializers, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.CollectionInitializerExpression, syntax, initializers, type, hasErrors || initializers.HasErrors())
{
Debug.Assert(!initializers.IsDefault, "Field 'initializers' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitCollectionInitializerExpression(this);
}
public BoundCollectionInitializerExpression Update(ImmutableArray initializers, TypeSymbol type)
{
if (initializers != this.Initializers || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundCollectionInitializerExpression(this.Syntax, initializers, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundCollectionInitializerExpression(this.Syntax, this.Initializers, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundCollectionElementInitializer : BoundExpression
{
public BoundCollectionElementInitializer(SyntaxNode syntax, MethodSymbol addMethod, ImmutableArray arguments, BoundExpression implicitReceiverOpt, bool expanded, ImmutableArray argsToParamsOpt, bool invokedAsExtensionMethod, LookupResultKind resultKind, Binder binderOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.CollectionElementInitializer, syntax, type, hasErrors || arguments.HasErrors() || implicitReceiverOpt.HasErrors())
{
Debug.Assert((object)addMethod != null, "Field 'addMethod' 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.AddMethod = addMethod;
this.Arguments = arguments;
this.ImplicitReceiverOpt = implicitReceiverOpt;
this.Expanded = expanded;
this.ArgsToParamsOpt = argsToParamsOpt;
this.InvokedAsExtensionMethod = invokedAsExtensionMethod;
this._ResultKind = resultKind;
this.BinderOpt = binderOpt;
}
public MethodSymbol AddMethod { get; }
public ImmutableArray Arguments { get; }
public BoundExpression ImplicitReceiverOpt { get; }
public bool Expanded { get; }
public ImmutableArray ArgsToParamsOpt { get; }
public bool InvokedAsExtensionMethod { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public Binder BinderOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitCollectionElementInitializer(this);
}
public BoundCollectionElementInitializer Update(MethodSymbol addMethod, ImmutableArray arguments, BoundExpression implicitReceiverOpt, bool expanded, ImmutableArray argsToParamsOpt, bool invokedAsExtensionMethod, LookupResultKind resultKind, Binder binderOpt, TypeSymbol type)
{
if (addMethod != this.AddMethod || arguments != this.Arguments || implicitReceiverOpt != this.ImplicitReceiverOpt || expanded != this.Expanded || argsToParamsOpt != this.ArgsToParamsOpt || invokedAsExtensionMethod != this.InvokedAsExtensionMethod || resultKind != this.ResultKind || binderOpt != this.BinderOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundCollectionElementInitializer(this.Syntax, addMethod, arguments, implicitReceiverOpt, expanded, argsToParamsOpt, invokedAsExtensionMethod, resultKind, binderOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundCollectionElementInitializer(this.Syntax, this.AddMethod, this.Arguments, this.ImplicitReceiverOpt, this.Expanded, this.ArgsToParamsOpt, this.InvokedAsExtensionMethod, this.ResultKind, this.BinderOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundDynamicCollectionElementInitializer : BoundDynamicInvocableBase
{
public BoundDynamicCollectionElementInitializer(SyntaxNode syntax, ImmutableArray applicableMethods, BoundExpression expression, ImmutableArray arguments, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.DynamicCollectionElementInitializer, 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((object)expression != null, "Field 'expression' 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ApplicableMethods = applicableMethods;
}
public ImmutableArray ApplicableMethods { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDynamicCollectionElementInitializer(this);
}
public BoundDynamicCollectionElementInitializer Update(ImmutableArray applicableMethods, BoundExpression expression, ImmutableArray arguments, TypeSymbol type)
{
if (applicableMethods != this.ApplicableMethods || expression != this.Expression || arguments != this.Arguments || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDynamicCollectionElementInitializer(this.Syntax, applicableMethods, expression, arguments, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDynamicCollectionElementInitializer(this.Syntax, this.ApplicableMethods, this.Expression, this.Arguments, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundImplicitReceiver : BoundExpression
{
public BoundImplicitReceiver(SyntaxNode syntax, TypeSymbol type, bool hasErrors)
: base(BoundKind.ImplicitReceiver, syntax, type, hasErrors)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public BoundImplicitReceiver(SyntaxNode syntax, TypeSymbol type)
: base(BoundKind.ImplicitReceiver, syntax, type)
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitImplicitReceiver(this);
}
public BoundImplicitReceiver Update(TypeSymbol type)
{
if (!TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundImplicitReceiver(this.Syntax, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundImplicitReceiver(this.Syntax, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundAnonymousObjectCreationExpression : BoundExpression
{
public BoundAnonymousObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray arguments, ImmutableArray declarations, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.AnonymousObjectCreationExpression, syntax, type, hasErrors || arguments.HasErrors() || declarations.HasErrors())
{
Debug.Assert((object)constructor != null, "Field 'constructor' 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(!declarations.IsDefault, "Field 'declarations' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Constructor = constructor;
this.Arguments = arguments;
this.Declarations = declarations;
}
public MethodSymbol Constructor { get; }
public ImmutableArray Arguments { get; }
public ImmutableArray Declarations { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitAnonymousObjectCreationExpression(this);
}
public BoundAnonymousObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray arguments, ImmutableArray declarations, TypeSymbol type)
{
if (constructor != this.Constructor || arguments != this.Arguments || declarations != this.Declarations || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAnonymousObjectCreationExpression(this.Syntax, constructor, arguments, declarations, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAnonymousObjectCreationExpression(this.Syntax, this.Constructor, this.Arguments, this.Declarations, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundAnonymousPropertyDeclaration : BoundExpression
{
public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type, bool hasErrors)
: base(BoundKind.AnonymousPropertyDeclaration, syntax, type, hasErrors)
{
Debug.Assert((object)property != null, "Field 'property' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Property = property;
}
public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type)
: base(BoundKind.AnonymousPropertyDeclaration, syntax, type)
{
Debug.Assert((object)property != null, "Field 'property' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Property = property;
}
public PropertySymbol Property { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitAnonymousPropertyDeclaration(this);
}
public BoundAnonymousPropertyDeclaration Update(PropertySymbol property, TypeSymbol type)
{
if (property != this.Property || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundAnonymousPropertyDeclaration(this.Syntax, property, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundAnonymousPropertyDeclaration(this.Syntax, this.Property, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundNewT : BoundExpression
{
public BoundNewT(SyntaxNode syntax, BoundObjectInitializerExpressionBase initializerExpressionOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.NewT, syntax, type, hasErrors || initializerExpressionOpt.HasErrors())
{
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.InitializerExpressionOpt = initializerExpressionOpt;
}
public BoundObjectInitializerExpressionBase InitializerExpressionOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitNewT(this);
}
public BoundNewT Update(BoundObjectInitializerExpressionBase initializerExpressionOpt, TypeSymbol type)
{
if (initializerExpressionOpt != this.InitializerExpressionOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundNewT(this.Syntax, initializerExpressionOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundNewT(this.Syntax, this.InitializerExpressionOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundDelegateCreationExpression : BoundExpression
{
public BoundDelegateCreationExpression(SyntaxNode syntax, BoundExpression argument, MethodSymbol methodOpt, bool isExtensionMethod, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.DelegateCreationExpression, syntax, type, hasErrors || argument.HasErrors())
{
Debug.Assert((object)argument != null, "Field 'argument' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Argument = argument;
this.MethodOpt = methodOpt;
this.IsExtensionMethod = isExtensionMethod;
}
public BoundExpression Argument { get; }
public MethodSymbol MethodOpt { get; }
public bool IsExtensionMethod { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitDelegateCreationExpression(this);
}
public BoundDelegateCreationExpression Update(BoundExpression argument, MethodSymbol methodOpt, bool isExtensionMethod, TypeSymbol type)
{
if (argument != this.Argument || methodOpt != this.MethodOpt || isExtensionMethod != this.IsExtensionMethod || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundDelegateCreationExpression(this.Syntax, argument, methodOpt, isExtensionMethod, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundDelegateCreationExpression(this.Syntax, this.Argument, this.MethodOpt, this.IsExtensionMethod, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundArrayCreation : BoundExpression
{
public BoundArrayCreation(SyntaxNode syntax, ImmutableArray bounds, BoundArrayInitialization initializerOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ArrayCreation, syntax, type, hasErrors || bounds.HasErrors() || initializerOpt.HasErrors())
{
Debug.Assert(!bounds.IsDefault, "Field 'bounds' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Bounds = bounds;
this.InitializerOpt = initializerOpt;
}
public ImmutableArray Bounds { get; }
public BoundArrayInitialization InitializerOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitArrayCreation(this);
}
public BoundArrayCreation Update(ImmutableArray bounds, BoundArrayInitialization initializerOpt, TypeSymbol type)
{
if (bounds != this.Bounds || initializerOpt != this.InitializerOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundArrayCreation(this.Syntax, bounds, initializerOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundArrayCreation(this.Syntax, this.Bounds, this.InitializerOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundArrayInitialization : BoundExpression
{
public BoundArrayInitialization(SyntaxNode syntax, ImmutableArray initializers, bool hasErrors = false)
: base(BoundKind.ArrayInitialization, syntax, null, hasErrors || initializers.HasErrors())
{
Debug.Assert(!initializers.IsDefault, "Field 'initializers' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.Initializers = initializers;
}
public ImmutableArray Initializers { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitArrayInitialization(this);
}
public BoundArrayInitialization Update(ImmutableArray initializers)
{
if (initializers != this.Initializers)
{
var result = new BoundArrayInitialization(this.Syntax, initializers, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundArrayInitialization(this.Syntax, this.Initializers, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal partial class BoundStackAllocArrayCreation : BoundExpression
{
protected BoundStackAllocArrayCreation(BoundKind kind, SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization initializerOpt, TypeSymbol type, bool hasErrors = false)
: base(kind, syntax, type, hasErrors)
{
Debug.Assert((object)elementType != null, "Field 'elementType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)count != null, "Field 'count' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ElementType = elementType;
this.Count = count;
this.InitializerOpt = initializerOpt;
}
public BoundStackAllocArrayCreation(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization initializerOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.StackAllocArrayCreation, syntax, type, hasErrors || count.HasErrors() || initializerOpt.HasErrors())
{
Debug.Assert((object)elementType != null, "Field 'elementType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)count != null, "Field 'count' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ElementType = elementType;
this.Count = count;
this.InitializerOpt = initializerOpt;
}
public TypeSymbol ElementType { get; }
public BoundExpression Count { get; }
public BoundArrayInitialization InitializerOpt { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitStackAllocArrayCreation(this);
}
public BoundStackAllocArrayCreation Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization initializerOpt, TypeSymbol type)
{
if (!TypeSymbol.Equals(elementType, this.ElementType, TypeCompareKind.ConsiderEverything) || count != this.Count || initializerOpt != this.InitializerOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundStackAllocArrayCreation(this.Syntax, elementType, count, initializerOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundStackAllocArrayCreation(this.Syntax, this.ElementType, this.Count, this.InitializerOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundConvertedStackAllocExpression : BoundStackAllocArrayCreation
{
public BoundConvertedStackAllocExpression(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization initializerOpt, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.ConvertedStackAllocExpression, syntax, elementType, count, initializerOpt, type, hasErrors || count.HasErrors() || initializerOpt.HasErrors())
{
Debug.Assert((object)elementType != null, "Field 'elementType' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)count != null, "Field 'count' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
}
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitConvertedStackAllocExpression(this);
}
public new BoundConvertedStackAllocExpression Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization initializerOpt, TypeSymbol type)
{
if (!TypeSymbol.Equals(elementType, this.ElementType, TypeCompareKind.ConsiderEverything) || count != this.Count || initializerOpt != this.InitializerOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundConvertedStackAllocExpression(this.Syntax, elementType, count, initializerOpt, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundConvertedStackAllocExpression(this.Syntax, this.ElementType, this.Count, this.InitializerOpt, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundFieldAccess : BoundExpression
{
public BoundFieldAccess(SyntaxNode syntax, BoundExpression receiverOpt, FieldSymbol fieldSymbol, ConstantValue constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.FieldAccess, syntax, type, hasErrors || receiverOpt.HasErrors())
{
Debug.Assert((object)fieldSymbol != null, "Field 'fieldSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ReceiverOpt = receiverOpt;
this.FieldSymbol = fieldSymbol;
this.ConstantValueOpt = constantValueOpt;
this._ResultKind = resultKind;
this.IsByValue = isByValue;
this.IsDeclaration = isDeclaration;
}
public BoundExpression ReceiverOpt { get; }
public FieldSymbol FieldSymbol { get; }
public ConstantValue ConstantValueOpt { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public bool IsByValue { get; }
public bool IsDeclaration { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitFieldAccess(this);
}
public BoundFieldAccess Update(BoundExpression receiverOpt, FieldSymbol fieldSymbol, ConstantValue constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type)
{
if (receiverOpt != this.ReceiverOpt || fieldSymbol != this.FieldSymbol || constantValueOpt != this.ConstantValueOpt || resultKind != this.ResultKind || isByValue != this.IsByValue || isDeclaration != this.IsDeclaration || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundFieldAccess(this.Syntax, receiverOpt, fieldSymbol, constantValueOpt, resultKind, isByValue, isDeclaration, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundFieldAccess(this.Syntax, this.ReceiverOpt, this.FieldSymbol, this.ConstantValueOpt, this.ResultKind, this.IsByValue, this.IsDeclaration, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundHoistedFieldAccess : BoundExpression
{
public BoundHoistedFieldAccess(SyntaxNode syntax, FieldSymbol fieldSymbol, TypeSymbol type, bool hasErrors)
: base(BoundKind.HoistedFieldAccess, syntax, type, hasErrors)
{
Debug.Assert((object)fieldSymbol != null, "Field 'fieldSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.FieldSymbol = fieldSymbol;
}
public BoundHoistedFieldAccess(SyntaxNode syntax, FieldSymbol fieldSymbol, TypeSymbol type)
: base(BoundKind.HoistedFieldAccess, syntax, type)
{
Debug.Assert((object)fieldSymbol != null, "Field 'fieldSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.FieldSymbol = fieldSymbol;
}
public FieldSymbol FieldSymbol { get; }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitHoistedFieldAccess(this);
}
public BoundHoistedFieldAccess Update(FieldSymbol fieldSymbol, TypeSymbol type)
{
if (fieldSymbol != this.FieldSymbol || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundHoistedFieldAccess(this.Syntax, fieldSymbol, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundHoistedFieldAccess(this.Syntax, this.FieldSymbol, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundPropertyAccess : BoundExpression
{
public BoundPropertyAccess(SyntaxNode syntax, BoundExpression receiverOpt, PropertySymbol propertySymbol, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.PropertyAccess, syntax, type, hasErrors || receiverOpt.HasErrors())
{
Debug.Assert((object)propertySymbol != null, "Field 'propertySymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ReceiverOpt = receiverOpt;
this.PropertySymbol = propertySymbol;
this._ResultKind = resultKind;
}
public BoundExpression ReceiverOpt { get; }
public PropertySymbol PropertySymbol { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitPropertyAccess(this);
}
public BoundPropertyAccess Update(BoundExpression receiverOpt, PropertySymbol propertySymbol, LookupResultKind resultKind, TypeSymbol type)
{
if (receiverOpt != this.ReceiverOpt || propertySymbol != this.PropertySymbol || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundPropertyAccess(this.Syntax, receiverOpt, propertySymbol, resultKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundPropertyAccess(this.Syntax, this.ReceiverOpt, this.PropertySymbol, this.ResultKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundEventAccess : BoundExpression
{
public BoundEventAccess(SyntaxNode syntax, BoundExpression receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.EventAccess, syntax, type, hasErrors || receiverOpt.HasErrors())
{
Debug.Assert((object)eventSymbol != null, "Field 'eventSymbol' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
Debug.Assert((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ReceiverOpt = receiverOpt;
this.EventSymbol = eventSymbol;
this.IsUsableAsField = isUsableAsField;
this._ResultKind = resultKind;
}
public BoundExpression ReceiverOpt { get; }
public EventSymbol EventSymbol { get; }
public bool IsUsableAsField { get; }
private readonly LookupResultKind _ResultKind;
public override LookupResultKind ResultKind { get { return _ResultKind;} }
public override BoundNode Accept(BoundTreeVisitor visitor)
{
return visitor.VisitEventAccess(this);
}
public BoundEventAccess Update(BoundExpression receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type)
{
if (receiverOpt != this.ReceiverOpt || eventSymbol != this.EventSymbol || isUsableAsField != this.IsUsableAsField || resultKind != this.ResultKind || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
{
var result = new BoundEventAccess(this.Syntax, receiverOpt, eventSymbol, isUsableAsField, resultKind, type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
return this;
}
protected override BoundExpression ShallowClone()
{
var result = new BoundEventAccess(this.Syntax, this.ReceiverOpt, this.EventSymbol, this.IsUsableAsField, this.ResultKind, this.Type, this.HasErrors);
result.CopyAttributes(this);
return result;
}
}
internal sealed partial class BoundIndexerAccess : BoundExpression
{
public BoundIndexerAccess(SyntaxNode syntax, BoundExpression receiverOpt, PropertySymbol indexer, ImmutableArray arguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, bool expanded, ImmutableArray argsToParamsOpt, Binder binderOpt, bool useSetterForDefaultArgumentGeneration, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.IndexerAccess, syntax, type, hasErrors || receiverOpt.HasErrors() || arguments.HasErrors())
{
Debug.Assert((object)indexer != null, "Field 'indexer' 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((object)type != null, "Field 'type' cannot be null (use Null=\"allow\" in BoundNodes.xml to remove this check)");
this.ReceiverOpt = receiverOpt;
this.Indexer = indexer;
this.Arguments = arguments;
this.ArgumentNamesOpt = argumentNamesOpt;
this.ArgumentRefKindsOpt = argumentRefKindsOpt;
this.Expanded = expanded;
this.ArgsToParamsOpt = argsToParamsOpt;
this.BinderOpt = binderOpt;
this.UseSetterForDefaultArgumentGeneration = useSetterForDefaultArgumentGeneration;
}
public BoundExpression ReceiverOpt { get; }
public PropertySymbol Indexer { get; }
public ImmutableArray Arguments { get; }
public ImmutableArray