Boo.Lang.Compiler.TypeSystem.GenericParameterInferrer.GetInferredTypes C# (CSharp) Method

GetInferredTypes() public method

public GetInferredTypes ( ) : IType[]
return IType[]
        public IType[] GetInferredTypes()
        {
            return Array.ConvertAll<IGenericParameter, IType>(
                GenericMethod.GenericInfo.GenericParameters,
                GetInferredType);
        }

Usage Example

Example #1
0
        /// <summary>
        /// Attempts to infer the generic parameters of a method from a set of arguments.
        /// </summary>
        /// <returns>
        /// An array consisting of inferred types for the method's generic arguments,
        /// or null if type inference failed.
        /// </returns>
        public IType[] InferMethodGenericArguments(IMethod method, ExpressionCollection arguments)
        {
            if (method.GenericInfo == null) return null;

            GenericParameterInferrer inferrerr = new GenericParameterInferrer(Context, method, arguments);
            if (inferrerr.Run())
            {
                return inferrerr.GetInferredTypes();
            }
            return null;
        }