C# Class IronRuby.Runtime.Calls.RubyOverloadResolver

Inheritance: Microsoft.Scripting.Actions.Calls.OverloadResolver
Exibir arquivo Open project: ExpertsInside/IronSP Class Usage Examples

Private Properties

Property Type Description
AddArgumentRestrictions void
AddSimpleHiddenMapping void
CreateActualArguments Microsoft.Scripting.Actions.Calls.ActualArguments
GetHiddenParameterCount int
GetParameterCount void
HasExplicitProtocolConversion bool
MakeAmbiguousCallError System.Linq.Expressions.Expression
MakeCallFailureError System.Linq.Expressions.Expression
MakeIncorrectArgumentCountError System.Linq.Expressions.Expression
MakeSplattedItem System.Dynamic.DynamicMetaObject
RubyOverloadResolver System.Linq.Expressions

Public Methods

Method Description
CanConvertFrom ( Microsoft.Scripting.Actions.Calls.ParameterWrapper fromParameter, Microsoft.Scripting.Actions.Calls.ParameterWrapper toParameter ) : bool
CanConvertFrom ( Type fromType, DynamicMetaObject fromArg, Microsoft.Scripting.Actions.Calls.ParameterWrapper toParameter, NarrowingLevel level ) : bool

Returns true if fromArg of type fromType can be assigned to toParameter with a conversion on given narrowing level.

Convert ( DynamicMetaObject metaObject, Type restrictedType, ParameterInfo info, Type toType ) : Expression
MakeInvalidParametersError ( BindingTarget target ) : Microsoft.Scripting.Actions.ErrorInfo
NormalizeArguments ( MetaObjectBuilder metaBuilder, CallArguments args, int minCount, int maxCount ) : IList
SelectBestConversionFor ( DynamicMetaObject arg, Microsoft.Scripting.Actions.Calls.ParameterWrapper candidateOne, Microsoft.Scripting.Actions.Calls.ParameterWrapper candidateTwo, NarrowingLevel level ) : Candidate

Protected Methods

Method Description
AllowMemberInitialization ( OverloadInfo method ) : bool
BindToUnexpandedParams ( MethodCandidate candidate ) : bool

We expand params arrays for library methods. Splat operator needs to be used to pass content of an array/list into params array method.

CreateActualArguments ( IList namedArgs, IList argNames, int preSplatLimit, int postSplatLimit ) : Microsoft.Scripting.Actions.Calls.ActualArguments
GetSplattedExpression ( ) : Expression
GetSplattedItem ( int index ) : object
MapSpecialParameters ( ParameterMapping mapping ) : BitArray

Private Methods

Method Description
AddArgumentRestrictions ( MetaObjectBuilder metaBuilder, BindingTarget bindingTarget ) : void
AddSimpleHiddenMapping ( ParameterMapping mapping, ParameterInfo info, bool prohibitNull ) : void
CreateActualArguments ( List normalized, MetaObjectBuilder metaBuilder, CallArguments args, int hidden, int preSplatLimit, int postSplatLimit, int &lastSplattedArg, IList &list, System.Linq.Expressions.ParameterExpression &listVariable ) : Microsoft.Scripting.Actions.Calls.ActualArguments
GetHiddenParameterCount ( OverloadInfo method, SelfCallConvention callConvention ) : int
GetParameterCount ( OverloadInfo method, SelfCallConvention callConvention, int &mandatory, int &optional ) : void
HasExplicitProtocolConversion ( Microsoft.Scripting.Actions.Calls.ParameterWrapper parameter ) : bool
MakeAmbiguousCallError ( BindingTarget target ) : Expression
MakeCallFailureError ( BindingTarget target ) : Expression
MakeIncorrectArgumentCountError ( BindingTarget target ) : Expression
MakeSplattedItem ( IList list, Expression listVariable, int index ) : DynamicMetaObject
RubyOverloadResolver ( MetaObjectBuilder metaBuilder, CallArguments args, SelfCallConvention callConvention, bool implicitProtocolConversions ) : System.Linq.Expressions

Method Details

AllowMemberInitialization() protected method

protected AllowMemberInitialization ( OverloadInfo method ) : bool
method Microsoft.Scripting.Actions.Calls.OverloadInfo
return bool

BindToUnexpandedParams() protected method

We expand params arrays for library methods. Splat operator needs to be used to pass content of an array/list into params array method.
protected BindToUnexpandedParams ( MethodCandidate candidate ) : bool
candidate Microsoft.Scripting.Actions.Calls.MethodCandidate
return bool

CanConvertFrom() public method

public CanConvertFrom ( Microsoft.Scripting.Actions.Calls.ParameterWrapper fromParameter, Microsoft.Scripting.Actions.Calls.ParameterWrapper toParameter ) : bool
fromParameter Microsoft.Scripting.Actions.Calls.ParameterWrapper
toParameter Microsoft.Scripting.Actions.Calls.ParameterWrapper
return bool

CanConvertFrom() public method

Returns true if fromArg of type fromType can be assigned to toParameter with a conversion on given narrowing level.
public CanConvertFrom ( Type fromType, DynamicMetaObject fromArg, Microsoft.Scripting.Actions.Calls.ParameterWrapper toParameter, NarrowingLevel level ) : bool
fromType System.Type
fromArg System.Dynamic.DynamicMetaObject
toParameter Microsoft.Scripting.Actions.Calls.ParameterWrapper
level NarrowingLevel
return bool

Convert() public method

public Convert ( DynamicMetaObject metaObject, Type restrictedType, ParameterInfo info, Type toType ) : Expression
metaObject System.Dynamic.DynamicMetaObject
restrictedType System.Type
info System.Reflection.ParameterInfo
toType System.Type
return System.Linq.Expressions.Expression

CreateActualArguments() protected method

protected CreateActualArguments ( IList namedArgs, IList argNames, int preSplatLimit, int postSplatLimit ) : Microsoft.Scripting.Actions.Calls.ActualArguments
namedArgs IList
argNames IList
preSplatLimit int
postSplatLimit int
return Microsoft.Scripting.Actions.Calls.ActualArguments

GetSplattedExpression() protected method

protected GetSplattedExpression ( ) : Expression
return System.Linq.Expressions.Expression

GetSplattedItem() protected method

protected GetSplattedItem ( int index ) : object
index int
return object

MakeInvalidParametersError() public method

public MakeInvalidParametersError ( BindingTarget target ) : Microsoft.Scripting.Actions.ErrorInfo
target Microsoft.Scripting.Actions.Calls.BindingTarget
return Microsoft.Scripting.Actions.ErrorInfo

MapSpecialParameters() protected method

protected MapSpecialParameters ( ParameterMapping mapping ) : BitArray
mapping Microsoft.Scripting.Actions.Calls.ParameterMapping
return System.Collections.BitArray

NormalizeArguments() public static method

public static NormalizeArguments ( MetaObjectBuilder metaBuilder, CallArguments args, int minCount, int maxCount ) : IList
metaBuilder MetaObjectBuilder
args CallArguments
minCount int
maxCount int
return IList

SelectBestConversionFor() public method

public SelectBestConversionFor ( DynamicMetaObject arg, Microsoft.Scripting.Actions.Calls.ParameterWrapper candidateOne, Microsoft.Scripting.Actions.Calls.ParameterWrapper candidateTwo, NarrowingLevel level ) : Candidate
arg System.Dynamic.DynamicMetaObject
candidateOne Microsoft.Scripting.Actions.Calls.ParameterWrapper
candidateTwo Microsoft.Scripting.Actions.Calls.ParameterWrapper
level NarrowingLevel
return Candidate