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
ResolveResultmethodName
stringmethods
IReadOnlyList<MethodListWithDeclaringType>typeArguments
IReadOnlyList<IType>
Properties
MethodName
Gets the name of the methods in this group.
public string MethodName { get; }
Property Value
Methods
Gets the methods that were found. This list does not include extension methods.
public IEnumerable<IMethod> Methods { get; }
Property Value
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
TargetResult
Gets the resolve result for the target object.
public ResolveResult TargetResult { get; }
Property Value
TargetType
Gets the type of the reference to the target object.
public IType TargetType { get; }
Property Value
TypeArguments
Gets the type arguments that were explicitly provided.
public IReadOnlyList<IType> TypeArguments { get; }
Property Value
Methods
GetChildResults()
public override IEnumerable<ResolveResult> GetChildResults()
Returns
GetEligibleExtensionMethods(bool)
Gets the eligible extension methods.
public IEnumerable<IEnumerable<IMethod>> GetEligibleExtensionMethods(bool substituteInferredTypes)
Parameters
substituteInferredTypes
boolSpecifies 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
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
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
ICompilationarguments
ResolveResult[]argumentNames
string[]allowExtensionMethods
boolallowExpandingParams
boolallowOptionalParameters
boolallowImplicitIn
boolcheckForOverflow
boolconversions
CSharpConversions
Returns
ToString()
public override string ToString()