76 lines
2.0 KiB
C#
76 lines
2.0 KiB
C#
using System.Collections.Immutable;
|
|
using Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp.Symbols;
|
|
|
|
internal sealed class DiscardSymbol : Symbol
|
|
{
|
|
public TypeWithAnnotations TypeWithAnnotations { get; }
|
|
|
|
public override Symbol? ContainingSymbol => null;
|
|
|
|
public override Accessibility DeclaredAccessibility => (Accessibility)0;
|
|
|
|
public override ImmutableArray<SyntaxReference> DeclaringSyntaxReferences => ImmutableArray<SyntaxReference>.Empty;
|
|
|
|
public override bool IsAbstract => false;
|
|
|
|
public override bool IsExtern => false;
|
|
|
|
public override bool IsImplicitlyDeclared => true;
|
|
|
|
public override bool IsOverride => false;
|
|
|
|
public override bool IsSealed => false;
|
|
|
|
public override bool IsStatic => false;
|
|
|
|
public override bool IsVirtual => false;
|
|
|
|
public override SymbolKind Kind => (SymbolKind)19;
|
|
|
|
public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
|
|
|
|
internal override ObsoleteAttributeData? ObsoleteAttributeData => null;
|
|
|
|
public DiscardSymbol(TypeWithAnnotations typeWithAnnotations)
|
|
{
|
|
TypeWithAnnotations = typeWithAnnotations;
|
|
}
|
|
|
|
internal override TResult Accept<TArgument, TResult>(CSharpSymbolVisitor<TArgument, TResult> visitor, TArgument a)
|
|
{
|
|
return visitor.VisitDiscard(this, a);
|
|
}
|
|
|
|
public override void Accept(CSharpSymbolVisitor visitor)
|
|
{
|
|
visitor.VisitDiscard(this);
|
|
}
|
|
|
|
public override TResult Accept<TResult>(CSharpSymbolVisitor<TResult> visitor)
|
|
{
|
|
return visitor.VisitDiscard(this);
|
|
}
|
|
|
|
public override bool Equals(Symbol? obj, TypeCompareKind compareKind)
|
|
{
|
|
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
|
|
if (obj is DiscardSymbol discardSymbol)
|
|
{
|
|
return TypeWithAnnotations.Equals(discardSymbol.TypeWithAnnotations, compareKind);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return TypeWithAnnotations.GetHashCode();
|
|
}
|
|
|
|
protected override ISymbol CreateISymbol()
|
|
{
|
|
return (ISymbol)(object)new Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.DiscardSymbol(this);
|
|
}
|
|
}
|