C# 클래스 Microsoft.Scripting.Actions.Calls.TypeInferer

파일 보기 프로젝트 열기: jschementi/iron

공개 메소드들

메소드 설명
GetInferedType ( Type genericParameter, Type parameterType, Type inputType, Type argType, Type>.Dictionary binding ) : Type

Provides generic type inference for a single parameter.

For example: M{T}(T x) M{T}(IList{T} x) M{T}(ref T x) M{T}(T[] x) M{T}(ref Dictionary{T,T}[] x)

비공개 메소드들

메소드 설명
AddDependency ( Dictionary dependencies, Type genArg, Type t ) : void
AddNestedDependencies ( Dictionary dependencies, Type genArg, Type t ) : void
AddOneInput ( ArgumentInputs>.Dictionary inputs, DynamicMetaObject arg, Type paramType ) : void

Adds any additional ArgumentInputs entries for the given object and parameter type.

CollectGenericParameters ( Type type, List containedGenArgs ) : void

Walks the nested generic hierarchy to construct all of the generic parameters referred to by this type. For example if getting the generic parameters for the x parameter on the method: void Foo{T0, T1}(Dictionary{T0, T1} x); We would add both typeof(T0) and typeof(T1) to the list of generic arguments.

ConstraintsViolated ( Type inputType, Type genericMethodParameterType, Type>.Dictionary binding ) : bool

Checks if the constraints are violated by the given input for the specified generic method parameter. This method must be supplied with a mapping for any dependent generic method type parameters which this one can be constrained to. For example for the signature "void Foo{T0, T1}(T0 x, T1 y) where T0 : T1". we cannot know if the constraints are violated unless we know what we have calculated T1 to be.

CreateNewArgBuilders ( MethodCandidate candidate, OverloadInfo newOverload ) : List

Creates a new set of arg builders for the given generic method definition which target the new parameters.

CreateNewWrappers ( MethodCandidate candidate, OverloadInfo newOverload, OverloadInfo oldOverload ) : List

Creates a new list of ParameterWrappers for the generic method replacing the old parameters with the new ones.

EnsureInputs ( ArgumentInputs>.Dictionary dict, Type type ) : ArgumentInputs
GetAllArguments ( Microsoft.Scripting.Actions.Calls.ApplicableCandidate candidate, Microsoft.Scripting.Actions.Calls.ActualArguments actualArgs ) : List
GetArgumentToInputMapping ( MethodCandidate candidate, IList args ) : ArgumentInputs>.Dictionary

Returns a mapping from generic type parameter to the input DMOs which map to it.

GetDependencyMapping ( OverloadInfo info ) : List>.Dictionary

Builds a mapping based upon generic parameter constraints between related generic parameters. This is then used to sort the generic parameters so that we can process the least dependent parameters first. For example given the method: void Foo{T0, T1}(T0 x, T1 y) where T0 : T1 We need to first infer the type information for T1 before we infer the type information for T0 so that we can ensure the constraints are correct.

GetGenericArgumentsForInferedMethod ( OverloadInfo target, Type>.Dictionary constraints ) : System.Type[]

Gets the generic arguments for method based upon the constraints discovered during type inference. Returns null if not all generic arguments had their types inferred.

GetInferedType ( OverloadResolver resolver, Type genericParameter, Type parameterType, DynamicMetaObject input, Type>.Dictionary binding, BindingRestrictions>.Dictionary restrictions ) : Type

Provides generic type inference for a single parameter.

For example: M{T}(T x) M{T}(IList{T} x) M{T}(ref T x) M{T}(T[] x) M{T}(ref Dictionary{T,T}[] x)

GetInferedTypeForInterface ( Type genericParameter, Type interfaceType, Type inputType, Type>.Dictionary binding ) : Type
GetSortedGenericArguments ( OverloadInfo info, Dictionary dependencies ) : System.Type[]

Gets the generic type arguments sorted so that the type arguments that are depended upon by other type arguments are sorted before their dependencies.

InferGenericMethod ( Microsoft.Scripting.Actions.Calls.ApplicableCandidate candidate, Microsoft.Scripting.Actions.Calls.ActualArguments actualArgs ) : MethodCandidate
IsDependentConstraint ( Dictionary dependencies, Type x, Type y ) : bool

Checks to see if the x type parameter is dependent upon the y type parameter.

MatchGenericParameter ( Type genericParameter, Type closedType, Type openType, Type>.Dictionary binding ) : Type
MatchGenericParameter ( Type genericParameter, Type closedType, Type openType, Type>.Dictionary binding, Type &match ) : bool

Finds all occurences of genericParameter in openType and the corresponding concrete types in closedType. Returns true iff all occurences of the generic parameter in the open type correspond to the same concrete type in the closed type and this type satisfies given constraints. Returns the concrete type in match if so.

메소드 상세

GetInferedType() 공개 정적인 메소드

Provides generic type inference for a single parameter.
For example: M{T}(T x) M{T}(IList{T} x) M{T}(ref T x) M{T}(T[] x) M{T}(ref Dictionary{T,T}[] x)
public static GetInferedType ( Type genericParameter, Type parameterType, Type inputType, Type argType, Type>.Dictionary binding ) : Type
genericParameter System.Type
parameterType System.Type
inputType System.Type
argType System.Type
binding Type>.Dictionary
리턴 System.Type