43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.Diagnostics;
|
|
using Microsoft.CodeAnalysis.CSharp.Symbols;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp;
|
|
|
|
internal sealed class BoundAnonymousPropertyDeclaration : BoundExpression
|
|
{
|
|
public override Symbol ExpressionSymbol => Property;
|
|
|
|
public new TypeSymbol Type => base.Type;
|
|
|
|
public PropertySymbol Property { get; }
|
|
|
|
public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type, bool hasErrors)
|
|
: base(BoundKind.AnonymousPropertyDeclaration, syntax, type, hasErrors)
|
|
{
|
|
Property = property;
|
|
}
|
|
|
|
public BoundAnonymousPropertyDeclaration(SyntaxNode syntax, PropertySymbol property, TypeSymbol type)
|
|
: base(BoundKind.AnonymousPropertyDeclaration, syntax, type)
|
|
{
|
|
Property = property;
|
|
}
|
|
|
|
[DebuggerStepThrough]
|
|
public override BoundNode? Accept(BoundTreeVisitor visitor)
|
|
{
|
|
return visitor.VisitAnonymousPropertyDeclaration(this);
|
|
}
|
|
|
|
public BoundAnonymousPropertyDeclaration Update(PropertySymbol property, TypeSymbol type)
|
|
{
|
|
if (!SymbolEqualityComparer.ConsiderEverything.Equals(property, Property) || !TypeSymbol.Equals(type, Type, (TypeCompareKind)0))
|
|
{
|
|
BoundAnonymousPropertyDeclaration boundAnonymousPropertyDeclaration = new BoundAnonymousPropertyDeclaration(Syntax, property, type, base.HasErrors);
|
|
boundAnonymousPropertyDeclaration.CopyAttributes(this);
|
|
return boundAnonymousPropertyDeclaration;
|
|
}
|
|
return this;
|
|
}
|
|
}
|