Boo.Lang.Compiler.TypeSystem.TypeSystemServices.FindImplicitConversionOperator C# (CSharp) Method

FindImplicitConversionOperator() public method

public FindImplicitConversionOperator ( IType fromType, IType toType ) : IMethod
fromType IType
toType IType
return IMethod
        public IMethod FindImplicitConversionOperator(IType fromType, IType toType)
        {
            return _findImplicitConversionOperator.Invoke(fromType, toType);
        }

Usage Example

コード例 #1
0
        private int CalculateArgumentScore(IType parameterType, IType argumentType)
        {
            if (parameterType == argumentType || (TypeSystemServices.IsSystemObject(argumentType) && TypeSystemServices.IsSystemObject(parameterType)))
            {
                return(parameterType is ICallableType ? CallableExactMatchScore : ExactMatchScore);
            }

            if (TypeCompatibilityRules.IsAssignableFrom(parameterType, argumentType))
            {
                var callableType = parameterType as ICallableType;
                var callableArg  = argumentType as ICallableType;
                if (callableType != null && callableArg != null)
                {
                    return(CalculateCallableScore(callableType, callableArg));
                }
                return(UpCastScore);
            }

            if (TypeSystemServices.FindImplicitConversionOperator(argumentType, parameterType) != null)
            {
                return(ImplicitConversionScore);
            }

            if (TypeSystemServices.CanBeReachedByPromotion(parameterType, argumentType))
            {
                return(IsWideningPromotion(parameterType, argumentType) ? WideningPromotion : NarrowingPromotion);
            }

            if (MyDowncastPermissions().CanBeReachedByDowncast(parameterType, argumentType))
            {
                return(DowncastScore);
            }

            return(-1);
        }
All Usage Examples Of Boo.Lang.Compiler.TypeSystem.TypeSystemServices::FindImplicitConversionOperator
TypeSystemServices