69 lines
3.4 KiB
C#
69 lines
3.4 KiB
C#
using System.Collections.Immutable;
|
|
using System.Diagnostics;
|
|
using Microsoft.CodeAnalysis.CSharp.Symbols;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp;
|
|
|
|
internal sealed class BoundObjectInitializerMember : BoundExpression, IBoundInvalidNode
|
|
{
|
|
public override Symbol? ExpressionSymbol => MemberSymbol;
|
|
|
|
ImmutableArray<BoundNode> IBoundInvalidNode.InvalidNodeChildren => StaticCast<BoundNode>.From<BoundExpression>(Arguments);
|
|
|
|
public new TypeSymbol Type => base.Type;
|
|
|
|
public Symbol? MemberSymbol { get; }
|
|
|
|
public ImmutableArray<BoundExpression> Arguments { get; }
|
|
|
|
public ImmutableArray<string> ArgumentNamesOpt { get; }
|
|
|
|
public ImmutableArray<RefKind> ArgumentRefKindsOpt { get; }
|
|
|
|
public bool Expanded { get; }
|
|
|
|
public ImmutableArray<int> ArgsToParamsOpt { get; }
|
|
|
|
public BitVector DefaultArguments { get; }
|
|
|
|
public override LookupResultKind ResultKind { get; }
|
|
|
|
public TypeSymbol ReceiverType { get; }
|
|
|
|
public BoundObjectInitializerMember(SyntaxNode syntax, Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, TypeSymbol receiverType, TypeSymbol type, bool hasErrors = false)
|
|
: base(BoundKind.ObjectInitializerMember, syntax, type, hasErrors || arguments.HasErrors())
|
|
{
|
|
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
|
|
MemberSymbol = memberSymbol;
|
|
Arguments = arguments;
|
|
ArgumentNamesOpt = argumentNamesOpt;
|
|
ArgumentRefKindsOpt = argumentRefKindsOpt;
|
|
Expanded = expanded;
|
|
ArgsToParamsOpt = argsToParamsOpt;
|
|
DefaultArguments = defaultArguments;
|
|
ResultKind = resultKind;
|
|
ReceiverType = receiverType;
|
|
}
|
|
|
|
[DebuggerStepThrough]
|
|
public override BoundNode? Accept(BoundTreeVisitor visitor)
|
|
{
|
|
return visitor.VisitObjectInitializerMember(this);
|
|
}
|
|
|
|
public BoundObjectInitializerMember Update(Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, TypeSymbol receiverType, TypeSymbol type)
|
|
{
|
|
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
|
|
if (!SymbolEqualityComparer.ConsiderEverything.Equals(memberSymbol, MemberSymbol) || arguments != Arguments || argumentNamesOpt != ArgumentNamesOpt || argumentRefKindsOpt != ArgumentRefKindsOpt || expanded != Expanded || argsToParamsOpt != ArgsToParamsOpt || defaultArguments != DefaultArguments || resultKind != ResultKind || !TypeSymbol.Equals(receiverType, ReceiverType, (TypeCompareKind)0) || !TypeSymbol.Equals(type, Type, (TypeCompareKind)0))
|
|
{
|
|
BoundObjectInitializerMember boundObjectInitializerMember = new BoundObjectInitializerMember(Syntax, memberSymbol, arguments, argumentNamesOpt, argumentRefKindsOpt, expanded, argsToParamsOpt, defaultArguments, resultKind, receiverType, type, base.HasErrors);
|
|
boundObjectInitializerMember.CopyAttributes(this);
|
|
return boundObjectInitializerMember;
|
|
}
|
|
return this;
|
|
}
|
|
}
|