Пример #1
0
        public TupleType ToTupleType(int n)
        {
            TupleType ret = new TupleType();        //$ NO registation. Badness?

            for (int i = 0; i < n; i++)
            {
                ret.Add(KeyType);
            }
            return(ret);
        }
Пример #2
0
        public TupleType ToTupleType(int n)
        {
            TupleType ret = new TupleType();    //$ no regs

            for (int i = 0; i < n; i++)
            {
                ret.Add(eltType);
            }
            return(ret);
        }
Пример #3
0
        /// <summary>
        /// If the self type is set, use the self type in the display
        /// This is for display purpose only, it may not be logically
        /// correct wrt some pathological programs
        /// </summary>
        private TupleType SimplifySelf(TupleType from)
        {
            TupleType simplified = new TupleType();     //$NO regs

            if (from.eltTypes.Count > 0)
            {
                if (Class != null)
                {
                    simplified.Add(Class.GetInstance());
                }
                else
                {
                    simplified.Add(from.Get(0));
                }
            }

            for (int i = 1; i < from.eltTypes.Count; i++)
            {
                simplified.Add(from.Get(i));
            }
            return(simplified);
        }