C# 클래스 ICSharpCode.NRefactory.CSharp.Resolver.OverloadResolution

C# overload resolution (C# 4.0 spec: §7.5).
파일 보기 프로젝트 열기: 0xd4d/NRefactory 1 사용 예제들

공개 메소드들

메소드 설명
AddCandidate ( IParameterizedMember member ) : OverloadResolutionErrors

Adds a candidate to overload resolution.

AddCandidate ( IParameterizedMember member, OverloadResolutionErrors additionalErrors ) : OverloadResolutionErrors

Adds a candidate to overload resolution.

AddMethodLists ( IList methodLists ) : void

Adds all candidates from the method lists. This method implements the logic that causes applicable methods in derived types to hide all methods in base types.

CreateResolveResult ( ResolveResult targetResolveResult, IList initializerStatements = null, IType returnTypeOverride = null ) : ICSharpCode.NRefactory.CSharp.Resolver.CSharpInvocationResolveResult

Creates a ResolveResult representing the result of overload resolution.

GetArgumentToParameterMap ( ) : IList

Gets an array that maps argument indices to parameter indices. For arguments that could not be mapped to any parameter, the value will be -1. parameterIndex = GetArgumentToParameterMap()[argumentIndex]

GetArgumentsWithConversions ( ) : IList

Returns the arguments for the method call in the order they were provided (not in the order of the parameters). Arguments are wrapped in a ConversionResolveResult if an implicit conversion is being applied to them when calling the method.

GetArgumentsWithConversionsAndNames ( ) : IList

Returns the arguments for the method call in the order they were provided (not in the order of the parameters). Arguments are wrapped in a ConversionResolveResult if an implicit conversion is being applied to them when calling the method. For arguments where an explicit argument name was provided, the argument will be wrapped in a NamedArgumentResolveResult.

GetBestCandidateWithSubstitutedTypeArguments ( ) : IParameterizedMember
IsApplicable ( OverloadResolutionErrors errors ) : bool

Returns whether a candidate with the given errors is still considered to be applicable.

OverloadResolution ( ICompilation compilation, ResolveResult arguments, string argumentNames = null, IType typeArguments = null, CSharpConversions conversions = null ) : System
ValidateConstraints ( ITypeParameter typeParameter, IType typeArgument, ICSharpCode.NRefactory.TypeSystem.TypeVisitor substitution = null ) : bool

Validates whether the given type argument satisfies the constraints for the given type parameter.

비공개 메소드들

메소드 설명
BetterFunctionMember ( Candidate c1, Candidate c2 ) : int

Returns 1 if c1 is better than c2; 2 if c2 is better than c1; or 0 if neither is better.

CalculateCandidate ( Candidate candidate ) : bool

Calculates applicability etc. for the candidate.

CheckApplicability ( Candidate candidate ) : void
ConsiderIfNewCandidateIsBest ( Candidate candidate ) : void
GetArgumentsWithConversions ( ResolveResult targetResolveResult, IParameterizedMember bestCandidateForNamedArguments ) : IList
GetSubstitution ( Candidate candidate ) : TypeParameterSubstitution
LogCandidateAddingResult ( string text, IParameterizedMember method, OverloadResolutionErrors errors ) : void
MapCorrespondingParameters ( Candidate candidate ) : void
MoreSpecificFormalParameter ( IType t1, IType t2 ) : int
MoreSpecificFormalParameters ( Candidate c1, Candidate c2 ) : int
MoreSpecificFormalParameters ( IEnumerable t1, IEnumerable t2 ) : int
ResolveParameterTypes ( Candidate candidate, bool useSpecializedParameters ) : bool
RunTypeInference ( Candidate candidate ) : void
ValidateConstraints ( ITypeParameter typeParameter, IType typeArgument, ICSharpCode.NRefactory.TypeSystem.TypeVisitor substitution, CSharpConversions conversions ) : bool
ValidateMethodConstraints ( Candidate candidate ) : OverloadResolutionErrors

메소드 상세

AddCandidate() 공개 메소드

Adds a candidate to overload resolution.
public AddCandidate ( IParameterizedMember member ) : OverloadResolutionErrors
member IParameterizedMember The candidate member to add.
리턴 OverloadResolutionErrors

AddCandidate() 공개 메소드

Adds a candidate to overload resolution.
public AddCandidate ( IParameterizedMember member, OverloadResolutionErrors additionalErrors ) : OverloadResolutionErrors
member IParameterizedMember The candidate member to add.
additionalErrors OverloadResolutionErrors Additional errors that apply to the candidate. /// This is used to represent errors during member lookup (e.g. OverloadResolutionErrors.Inaccessible) /// in overload resolution.
리턴 OverloadResolutionErrors

AddMethodLists() 공개 메소드

Adds all candidates from the method lists. This method implements the logic that causes applicable methods in derived types to hide all methods in base types.
public AddMethodLists ( IList methodLists ) : void
methodLists IList The methods, grouped by declaring type. Base types must come first in the list.
리턴 void

CreateResolveResult() 공개 메소드

Creates a ResolveResult representing the result of overload resolution.
public CreateResolveResult ( ResolveResult targetResolveResult, IList initializerStatements = null, IType returnTypeOverride = null ) : ICSharpCode.NRefactory.CSharp.Resolver.CSharpInvocationResolveResult
targetResolveResult ResolveResult /// The target expression of the call. May be null for static methods/constructors. ///
initializerStatements IList /// Statements for Objects/Collections initializer. /// /// /// If not null, use this instead of the ReturnType of the member as the type of the created resolve result. ///
returnTypeOverride IType
리턴 ICSharpCode.NRefactory.CSharp.Resolver.CSharpInvocationResolveResult

GetArgumentToParameterMap() 공개 메소드

Gets an array that maps argument indices to parameter indices. For arguments that could not be mapped to any parameter, the value will be -1. parameterIndex = GetArgumentToParameterMap()[argumentIndex]
public GetArgumentToParameterMap ( ) : IList
리턴 IList

GetArgumentsWithConversions() 공개 메소드

Returns the arguments for the method call in the order they were provided (not in the order of the parameters). Arguments are wrapped in a ConversionResolveResult if an implicit conversion is being applied to them when calling the method.
public GetArgumentsWithConversions ( ) : IList
리턴 IList

GetArgumentsWithConversionsAndNames() 공개 메소드

Returns the arguments for the method call in the order they were provided (not in the order of the parameters). Arguments are wrapped in a ConversionResolveResult if an implicit conversion is being applied to them when calling the method. For arguments where an explicit argument name was provided, the argument will be wrapped in a NamedArgumentResolveResult.
public GetArgumentsWithConversionsAndNames ( ) : IList
리턴 IList

GetBestCandidateWithSubstitutedTypeArguments() 공개 메소드

public GetBestCandidateWithSubstitutedTypeArguments ( ) : IParameterizedMember
리턴 IParameterizedMember

IsApplicable() 공개 정적인 메소드

Returns whether a candidate with the given errors is still considered to be applicable.
public static IsApplicable ( OverloadResolutionErrors errors ) : bool
errors OverloadResolutionErrors
리턴 bool

OverloadResolution() 공개 메소드

public OverloadResolution ( ICompilation compilation, ResolveResult arguments, string argumentNames = null, IType typeArguments = null, CSharpConversions conversions = null ) : System
compilation ICompilation
arguments ResolveResult
argumentNames string
typeArguments IType
conversions CSharpConversions
리턴 System

ValidateConstraints() 공개 정적인 메소드

Validates whether the given type argument satisfies the constraints for the given type parameter.
public static ValidateConstraints ( ITypeParameter typeParameter, IType typeArgument, ICSharpCode.NRefactory.TypeSystem.TypeVisitor substitution = null ) : bool
typeParameter ITypeParameter The type parameter.
typeArgument IType The type argument.
substitution ICSharpCode.NRefactory.TypeSystem.TypeVisitor The substitution that defines how type parameters are replaced with type arguments. /// The substitution is used to check constraints that depend on other type parameters (or recursively on the same type parameter). /// May be null if no substitution should be used.
리턴 bool