Table of Contents

Class MethodGroupResolveResult

Namespace
ICSharpCode.Decompiler.CSharp.Resolver
Assembly
ICSharpCode.Decompiler.dll

Represents a group of methods. A method reference used to create a delegate is resolved to a MethodGroupResolveResult. The MethodGroupResolveResult has no type. To retrieve the delegate type or the chosen overload, look at the method group conversion.

public class MethodGroupResolveResult : ResolveResult
Inheritance
MethodGroupResolveResult
Inherited Members
Extension Methods

Constructors

MethodGroupResolveResult(ResolveResult, string, IReadOnlyList<MethodListWithDeclaringType>, IReadOnlyList<IType>)

public MethodGroupResolveResult(ResolveResult targetResult, string methodName, IReadOnlyList<MethodListWithDeclaringType> methods, IReadOnlyList<IType> typeArguments)

Parameters

targetResult ResolveResult
methodName string
methods IReadOnlyList<MethodListWithDeclaringType>
typeArguments IReadOnlyList<IType>

Properties

MethodName

Gets the name of the methods in this group.

public string MethodName { get; }

Property Value

string

Methods

Gets the methods that were found. This list does not include extension methods.

public IEnumerable<IMethod> Methods { get; }

Property Value

IEnumerable<IMethod>

MethodsGroupedByDeclaringType

Gets the methods that were found, grouped by their declaring type. This list does not include extension methods. Base types come first in the list.

public IEnumerable<MethodListWithDeclaringType> MethodsGroupedByDeclaringType { get; }

Property Value

IEnumerable<MethodListWithDeclaringType>

TargetResult

Gets the resolve result for the target object.

public ResolveResult TargetResult { get; }

Property Value

ResolveResult

TargetType

Gets the type of the reference to the target object.

public IType TargetType { get; }

Property Value

IType

TypeArguments

Gets the type arguments that were explicitly provided.

public IReadOnlyList<IType> TypeArguments { get; }

Property Value

IReadOnlyList<IType>

Methods

GetChildResults()

public override IEnumerable<ResolveResult> GetChildResults()

Returns

IEnumerable<ResolveResult>

GetEligibleExtensionMethods(bool)

Gets the eligible extension methods.

public IEnumerable<IEnumerable<IMethod>> GetEligibleExtensionMethods(bool substituteInferredTypes)

Parameters

substituteInferredTypes bool

Specifies whether to produce a SpecializedMethod when type arguments could be inferred from TargetType. This setting is only used for inferred types and has no effect if the type parameters are specified explicitly.

Returns

IEnumerable<IEnumerable<IMethod>>

Remarks

The results are stored in nested lists because they are grouped by using scope. That is, for "using SomeExtensions; namespace X { using MoreExtensions; ... }", the return value will be new List { new List { all extensions from MoreExtensions }, new List { all extensions from SomeExtensions } }

GetExtensionMethods()

Gets all candidate extension methods. Note: this includes candidates that are not eligible due to an inapplicable this argument. The candidates will only be specialized if the type arguments were provided explicitly.

public IEnumerable<IEnumerable<IMethod>> GetExtensionMethods()

Returns

IEnumerable<IEnumerable<IMethod>>

Remarks

The results are stored in nested lists because they are grouped by using scope. That is, for "using SomeExtensions; namespace X { using MoreExtensions; ... }", the return value will be new List { new List { all extensions from MoreExtensions }, new List { all extensions from SomeExtensions } }

PerformOverloadResolution(ICompilation, ResolveResult[], string[], bool, bool, bool, bool, bool, CSharpConversions)

public OverloadResolution PerformOverloadResolution(ICompilation compilation, ResolveResult[] arguments, string[] argumentNames = null, bool allowExtensionMethods = true, bool allowExpandingParams = true, bool allowOptionalParameters = true, bool allowImplicitIn = true, bool checkForOverflow = false, CSharpConversions conversions = null)

Parameters

compilation ICompilation
arguments ResolveResult[]
argumentNames string[]
allowExtensionMethods bool
allowExpandingParams bool
allowOptionalParameters bool
allowImplicitIn bool
checkForOverflow bool
conversions CSharpConversions

Returns

OverloadResolution

ToString()

public override string ToString()

Returns

string