Ejemplo n.º 1
0
        public int Accepts(CheezType lhs, CheezType rhs)
        {
            var ml = LhsType.Match(lhs, null);
            var mr = RhsType.Match(rhs, null);

            if (ml == -1 || mr == -1)
            {
                return(-1);
            }

            return(ml + mr);
        }
Ejemplo n.º 2
0
        public int Accepts(CheezType lhs, CheezType rhs)
        {
            Dictionary <string, (CheezType type, object value)> polyTypes = null;

            if (LhsType.IsPolyType || RhsType.IsPolyType)
            {
                polyTypes = new Dictionary <string, (CheezType type, object value)>();
                Workspace.CollectPolyTypes(LhsType, lhs, polyTypes);
                Workspace.CollectPolyTypes(RhsType, rhs, polyTypes);
            }


            var ml = LhsType.Match(lhs, polyTypes);
            var mr = RhsType.Match(rhs, polyTypes);

            if (ml == -1 || mr == -1)
            {
                return(-1);
            }
            return(ml + mr);
        }