Table of Contents

Class SpecializedMethod

Namespace
ICSharpCode.Decompiler.TypeSystem.Implementation
Assembly
ICSharpCode.Decompiler.dll

Represents a specialized IMethod (e.g. after type substitution).

public class SpecializedMethod : SpecializedParameterizedMember, IMethod, IParameterizedMember, IMember, IEntity, ISymbol, ICompilationProvider, INamedElement
Inheritance
SpecializedMethod
Implements
Inherited Members
Extension Methods

Constructors

SpecializedMethod(IMethod, TypeParameterSubstitution)

public SpecializedMethod(IMethod methodDefinition, TypeParameterSubstitution substitution)

Parameters

methodDefinition IMethod
substitution TypeParameterSubstitution

Properties

AccessorKind

Gets the kind of accessor this is.

public MethodSemanticsAttributes AccessorKind { get; }

Property Value

MethodSemanticsAttributes

AccessorOwner

If this method is an accessor, returns the corresponding property/event. Otherwise, returns null.

public IMember AccessorOwner { get; }

Property Value

IMember

HasBody

Gets whether the method has a body. This property returns false for abstract or extern methods, or for partial methods without implementation.

public bool HasBody { get; }

Property Value

bool

IsAccessor

Gets whether the method is a property/event accessor.

public bool IsAccessor { get; }

Property Value

bool

IsConstructor

public bool IsConstructor { get; }

Property Value

bool

IsDestructor

public bool IsDestructor { get; }

Property Value

bool

IsExtensionMethod

public bool IsExtensionMethod { get; }

Property Value

bool

IsLocalFunction

public bool IsLocalFunction { get; }

Property Value

bool

IsOperator

public bool IsOperator { get; }

Property Value

bool

ReducedFrom

If this method is reduced from an extension method or a local function returns the original method, null otherwise. A reduced method doesn't contain the extension method parameter. That means that it has one parameter less than its definition. A local function doesn't contain compiler-generated method parameters at the end.

public IMethod ReducedFrom { get; }

Property Value

IMethod

ReturnTypeIsRefReadOnly

Gets whether the return type is 'ref readonly'.

public bool ReturnTypeIsRefReadOnly { get; }

Property Value

bool

TypeArguments

Gets the type arguments passed to this method. If the method is generic but not parameterized yet, this property returns the type parameters, as if the method was parameterized with its own type arguments (void M<T>() { M<T>(); }).

public IReadOnlyList<IType> TypeArguments { get; }

Property Value

IReadOnlyList<IType>

TypeParameters

Gets the type parameters of this method; or an empty list if the method is not generic.

public IReadOnlyList<ITypeParameter> TypeParameters { get; }

Property Value

IReadOnlyList<ITypeParameter>

Methods

Equals(IMember, TypeVisitor)

Gets whether the members are considered equal when applying the specified type normalization.

public override bool Equals(IMember obj, TypeVisitor typeNormalization)

Parameters

obj IMember
typeNormalization TypeVisitor

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

GetReturnTypeAttributes()

public IEnumerable<IAttribute> GetReturnTypeAttributes()

Returns

IEnumerable<IAttribute>

Specialize(TypeParameterSubstitution)

Specializes this member with the given substitution. If this member is already specialized, the new substitution is composed with the existing substition.

public override IMember Specialize(TypeParameterSubstitution newSubstitution)

Parameters

newSubstitution TypeParameterSubstitution

Returns

IMember

ToString()

public override string ToString()

Returns

string