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

Infer() private method

Attempts to infer the type of generic parameters that occur in a formal parameter type according to its actual argument type.
private Infer ( IType formalType, IType actualType, Inference inference ) : bool
formalType IType
actualType IType
inference Inference
return bool
        private bool Infer(IType formalType, IType actualType, Inference inference)
        {
            // Skip unspecified actual types
            if (actualType == null) return true;

            if (formalType is IGenericParameter)
            {
                return InferGenericParameter((IGenericParameter)formalType, actualType, inference);
            }

            if (formalType is ICallableType)
            {
                return InferCallableType((ICallableType)formalType, actualType, inference);
            }

            if (formalType.ConstructedInfo != null)
            {
                return InferConstructedType(formalType, actualType, inference);
            }

            if (formalType is IArrayType)
            {
                return InferArrayType((IArrayType)formalType, actualType, inference);
            }

            return InferSimpleType(formalType, actualType, inference);
        }