342 lines
10 KiB
C#
342 lines
10 KiB
C#
using System.Collections.Generic;
|
|
using System.Collections.Immutable;
|
|
using System.Reflection;
|
|
using System.Reflection.Metadata;
|
|
using Microsoft.Cci;
|
|
using Roslyn.Utilities;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp.Symbols;
|
|
|
|
internal sealed class SignatureOnlyMethodSymbol : MethodSymbol
|
|
{
|
|
private readonly string _name;
|
|
|
|
private readonly TypeSymbol _containingType;
|
|
|
|
private readonly MethodKind _methodKind;
|
|
|
|
private readonly CallingConvention _callingConvention;
|
|
|
|
private readonly ImmutableArray<TypeParameterSymbol> _typeParameters;
|
|
|
|
private readonly ImmutableArray<ParameterSymbol> _parameters;
|
|
|
|
private readonly RefKind _refKind;
|
|
|
|
private readonly bool _isInitOnly;
|
|
|
|
private readonly bool _isStatic;
|
|
|
|
private readonly TypeWithAnnotations _returnType;
|
|
|
|
private readonly ImmutableArray<CustomModifier> _refCustomModifiers;
|
|
|
|
private readonly ImmutableArray<MethodSymbol> _explicitInterfaceImplementations;
|
|
|
|
internal override CallingConvention CallingConvention => _callingConvention;
|
|
|
|
public override bool IsVararg => new SignatureHeader((byte)_callingConvention).CallingConvention == SignatureCallingConvention.VarArgs;
|
|
|
|
public override bool IsGenericMethod => Arity > 0;
|
|
|
|
public override int Arity => _typeParameters.Length;
|
|
|
|
public override ImmutableArray<TypeParameterSymbol> TypeParameters => _typeParameters;
|
|
|
|
public override bool ReturnsVoid => _returnType.IsVoidType();
|
|
|
|
public override RefKind RefKind => _refKind;
|
|
|
|
public override TypeWithAnnotations ReturnTypeWithAnnotations => _returnType;
|
|
|
|
public override FlowAnalysisAnnotations ReturnTypeFlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
|
|
|
|
public override ImmutableHashSet<string> ReturnNotNullIfParameterNotNull => ImmutableHashSet<string>.Empty;
|
|
|
|
public override FlowAnalysisAnnotations FlowAnalysisAnnotations => FlowAnalysisAnnotations.None;
|
|
|
|
public override ImmutableArray<CustomModifier> RefCustomModifiers => _refCustomModifiers;
|
|
|
|
public override ImmutableArray<ParameterSymbol> Parameters => _parameters;
|
|
|
|
public override ImmutableArray<MethodSymbol> ExplicitInterfaceImplementations => _explicitInterfaceImplementations;
|
|
|
|
public override Symbol ContainingSymbol => _containingType;
|
|
|
|
public override MethodKind MethodKind => _methodKind;
|
|
|
|
public override string Name => _name;
|
|
|
|
internal override bool GenerateDebugInfo
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 101);
|
|
}
|
|
}
|
|
|
|
internal override bool HasSpecialName
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 103);
|
|
}
|
|
}
|
|
|
|
internal override MethodImplAttributes ImplementationAttributes
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 105);
|
|
}
|
|
}
|
|
|
|
internal override bool RequiresSecurityObject
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 107);
|
|
}
|
|
}
|
|
|
|
internal override MarshalPseudoCustomAttributeData ReturnValueMarshallingInformation
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 111);
|
|
}
|
|
}
|
|
|
|
internal override bool HasDeclarativeSecurity
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 113);
|
|
}
|
|
}
|
|
|
|
internal override ObsoleteAttributeData ObsoleteAttributeData
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 117);
|
|
}
|
|
}
|
|
|
|
public override ImmutableArray<TypeWithAnnotations> TypeArgumentsWithAnnotations
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 123);
|
|
}
|
|
}
|
|
|
|
public override Symbol AssociatedSymbol
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 125);
|
|
}
|
|
}
|
|
|
|
public override bool IsExtensionMethod
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 127);
|
|
}
|
|
}
|
|
|
|
public override bool HidesBaseMethodsByName
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 129);
|
|
}
|
|
}
|
|
|
|
public override ImmutableArray<Location> Locations
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 131);
|
|
}
|
|
}
|
|
|
|
public override ImmutableArray<SyntaxReference> DeclaringSyntaxReferences
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 133);
|
|
}
|
|
}
|
|
|
|
public override Accessibility DeclaredAccessibility
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 135);
|
|
}
|
|
}
|
|
|
|
public override bool IsStatic => _isStatic;
|
|
|
|
public override bool IsAsync
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 139);
|
|
}
|
|
}
|
|
|
|
public override bool IsVirtual
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 141);
|
|
}
|
|
}
|
|
|
|
public override bool IsOverride
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 143);
|
|
}
|
|
}
|
|
|
|
public override bool IsAbstract
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 145);
|
|
}
|
|
}
|
|
|
|
public override bool IsSealed
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 147);
|
|
}
|
|
}
|
|
|
|
public override bool IsExtern
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 149);
|
|
}
|
|
}
|
|
|
|
public override bool AreLocalsZeroed
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 151);
|
|
}
|
|
}
|
|
|
|
public override AssemblySymbol ContainingAssembly
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 153);
|
|
}
|
|
}
|
|
|
|
internal override ModuleSymbol ContainingModule
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 155);
|
|
}
|
|
}
|
|
|
|
internal override bool IsMetadataFinal
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 165);
|
|
}
|
|
}
|
|
|
|
internal override bool IsDeclaredReadOnly => false;
|
|
|
|
internal override bool IsInitOnly => _isInitOnly;
|
|
|
|
protected sealed override bool HasSetsRequiredMembersImpl
|
|
{
|
|
get
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 175);
|
|
}
|
|
}
|
|
|
|
internal sealed override bool HasUnscopedRefAttribute => false;
|
|
|
|
internal sealed override bool UseUpdatedEscapeRules => true;
|
|
|
|
public SignatureOnlyMethodSymbol(string name, TypeSymbol containingType, MethodKind methodKind, CallingConvention callingConvention, ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<ParameterSymbol> parameters, RefKind refKind, bool isInitOnly, bool isStatic, TypeWithAnnotations returnType, ImmutableArray<CustomModifier> refCustomModifiers, ImmutableArray<MethodSymbol> explicitInterfaceImplementations)
|
|
{
|
|
//IL_0007: 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_0017: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
|
|
_callingConvention = callingConvention;
|
|
_typeParameters = typeParameters;
|
|
_refKind = refKind;
|
|
_isInitOnly = isInitOnly;
|
|
_isStatic = isStatic;
|
|
_returnType = returnType;
|
|
_refCustomModifiers = refCustomModifiers;
|
|
_parameters = parameters;
|
|
_explicitInterfaceImplementations = ImmutableArrayExtensions.NullToEmpty<MethodSymbol>(explicitInterfaceImplementations);
|
|
_containingType = containingType;
|
|
_methodKind = methodKind;
|
|
_name = name;
|
|
}
|
|
|
|
internal sealed override bool IsNullableAnalysisEnabled()
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 97);
|
|
}
|
|
|
|
public override DllImportData GetDllImportData()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
internal override IEnumerable<SecurityAttribute> GetSecurityInformation()
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 115);
|
|
}
|
|
|
|
internal sealed override UnmanagedCallersOnlyAttributeData GetUnmanagedCallersOnlyAttributeData(bool forceComplete)
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 119);
|
|
}
|
|
|
|
internal override ImmutableArray<string> GetAppliedConditionalSymbols()
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 121);
|
|
}
|
|
|
|
internal sealed override bool IsMetadataNewSlot(bool ignoreInterfaceImplementationChanges = false)
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 157);
|
|
}
|
|
|
|
internal sealed override bool IsMetadataVirtual(bool ignoreInterfaceImplementationChanges = false)
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 159);
|
|
}
|
|
|
|
internal override int CalculateLocalSyntaxOffset(int localPosition, SyntaxTree localTree)
|
|
{
|
|
throw ExceptionUtilities.Unreachable("/_/src/Compilers/CSharp/Portable/Symbols/SignatureOnlyMethodSymbol.cs", 173);
|
|
}
|
|
}
|