Boo.Lang.Compiler.TypeSystem.CallableResolutionService.ResolveCallableReference C# (CSharp) Method

ResolveCallableReference() public method

public ResolveCallableReference ( Boo.Lang.Compiler.Ast.ExpressionCollection args, IEntity candidates ) : IEntity
args Boo.Lang.Compiler.Ast.ExpressionCollection
candidates IEntity
return IEntity
        public IEntity ResolveCallableReference(ExpressionCollection args, IEntity[] candidates)
        {
            Reset(args, candidates);

            InferGenericMethods();
            FindApplicableCandidates();

            if (ValidCandidates.Count == 0) return null;
            if (ValidCandidates.Count == 1) return (ValidCandidates[0]).Method;

            List<Candidate> dataPreserving = FindDataPreservingCandidates();
            if (dataPreserving.Count > 0)
            {
                FindBestMethod(dataPreserving);
                if (dataPreserving.Count == 1) return (dataPreserving[0]).Method;
            }

            FindBestMethod(_candidates);
            if (ValidCandidates.Count == 1) return (ValidCandidates[0].Method);
            return null;
        }