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

38 lines
1.1 KiB
C#

using System;
using System.Diagnostics;
using Microsoft.CodeAnalysis.CSharp.Symbols;
namespace Microsoft.CodeAnalysis.CSharp;
internal sealed class BoundUnconvertedAddressOfOperator : BoundExpression
{
public override object Display => (FormattableString)$"&{Operand.Display}";
public BoundMethodGroup Operand { get; }
public new TypeSymbol? Type => base.Type;
public BoundUnconvertedAddressOfOperator(SyntaxNode syntax, BoundMethodGroup operand, bool hasErrors = false)
: base(BoundKind.UnconvertedAddressOfOperator, syntax, null, hasErrors || operand.HasErrors())
{
Operand = operand;
}
[DebuggerStepThrough]
public override BoundNode? Accept(BoundTreeVisitor visitor)
{
return visitor.VisitUnconvertedAddressOfOperator(this);
}
public BoundUnconvertedAddressOfOperator Update(BoundMethodGroup operand)
{
if (operand != Operand)
{
BoundUnconvertedAddressOfOperator boundUnconvertedAddressOfOperator = new BoundUnconvertedAddressOfOperator(Syntax, operand, base.HasErrors);
boundUnconvertedAddressOfOperator.CopyAttributes(this);
return boundUnconvertedAddressOfOperator;
}
return this;
}
}