Beispiel #1
0
        public bool MatchSig(JsMethodSignature signature, MatchAntiCycle antiCycle = null)
        {
            if (signature == this)
            {
                return(true);
            }

            antiCycle = antiCycle ?? new MatchAntiCycle();

            if (this.MoreArgsType == null && (signature.MoreArgsType != null || signature.ArgumentTypes.Length > this.ArgumentTypes.Length))
            {
                return(false);
            }

            if (!ArgumentTypes.Zip(signature.ArgumentTypes, (a, b) => a.MatchType(b, antiCycle)).All(_ => _))
            {
                return(false);
            }

            if (!signature.ArgumentTypes.Skip(this.ArgumentTypes.Length).All(a => this.MoreArgsType.MatchType(a, antiCycle)))
            {
                return(false);
            }

            if (!this.ArgumentTypes.Skip(signature.ArgumentTypes.Length).All(a => a.MatchType(signature.MoreArgsType, antiCycle)))
            {
                return(false);
            }

            return(true);
        }