Files
2026-08-27 10:56:38 -06:00

51 lines
2.3 KiB
C#

using System.Diagnostics;
using Microsoft.CodeAnalysis.CSharp.Symbols;
namespace Microsoft.CodeAnalysis.CSharp;
internal sealed class BoundPropertyAccess : BoundExpression
{
public override Symbol? ExpressionSymbol => PropertySymbol;
public new TypeSymbol Type => base.Type;
public BoundExpression? ReceiverOpt { get; }
public ThreeState InitialBindingReceiverIsSubjectToCloning { get; }
public PropertySymbol PropertySymbol { get; }
public override LookupResultKind ResultKind { get; }
public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
: base(BoundKind.PropertyAccess, syntax, type, hasErrors || receiverOpt.HasErrors())
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
ReceiverOpt = receiverOpt;
InitialBindingReceiverIsSubjectToCloning = initialBindingReceiverIsSubjectToCloning;
PropertySymbol = propertySymbol;
ResultKind = resultKind;
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor)
{
return visitor.VisitPropertyAccess(this);
}
public BoundPropertyAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, LookupResultKind resultKind, TypeSymbol type)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
if (receiverOpt != ReceiverOpt || initialBindingReceiverIsSubjectToCloning != InitialBindingReceiverIsSubjectToCloning || !SymbolEqualityComparer.ConsiderEverything.Equals(propertySymbol, PropertySymbol) || resultKind != ResultKind || !TypeSymbol.Equals(type, Type, (TypeCompareKind)0))
{
BoundPropertyAccess boundPropertyAccess = new BoundPropertyAccess(Syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, propertySymbol, resultKind, type, base.HasErrors);
boundPropertyAccess.CopyAttributes(this);
return boundPropertyAccess;
}
return this;
}
}