예제 #1
0
        // friend: RubyContext
        // tracker: non-null => show members declared on the tracker
        internal RubyClass(RubyContext /*!*/ context, string name, Type type, object singletonClassOf, Action <RubyModule> initializer,
                           RubyClass superClass, TypeTracker tracker, bool isRubyClass, bool isSingletonClass)
            : base(context, name, initializer, null, tracker)
        {
            Debug.Assert((superClass == null) == (type == typeof(object)), "All classes have a superclass, except for Object");
            Debug.Assert(!isRubyClass || tracker == null, "Ruby class cannot have a tracker");
            Debug.Assert(singletonClassOf != null || !isSingletonClass, "Singleton classes don't have a type");
            Debug.Assert(superClass != this);

            _underlyingSystemType = type;
            _superClass           = superClass;
            _isSingletonClass     = isSingletonClass;
            _isRubyClass          = isRubyClass;
            _singletonClassOf     = singletonClassOf;

            if (superClass != null)
            {
                superClass.AddDependentModule(this);
                _structInfo = superClass._structInfo;
            }
        }