internal RubyModule(RubyContext/*!*/ context, string name, Action<RubyModule> methodsInitializer, Action<RubyModule> constantsInitializer,
RubyModule/*!*/[] expandedMixins, NamespaceTracker namespaceTracker, TypeTracker typeTracker, ModuleRestrictions restrictions) {
Assert.NotNull(context);
Debug.Assert(namespaceTracker == null || typeTracker == null || typeTracker.Type == typeof(object));
Debug.Assert(expandedMixins == null ||
CollectionUtils.TrueForAll(expandedMixins, (m) => m != this && m != null && !m.IsClass && m.Context == context)
);
_context = context;
_name = name;
_methodsInitializer = methodsInitializer;
_constantsInitializer = constantsInitializer;
_namespaceTracker = namespaceTracker;
_typeTracker = typeTracker;
_mixins = expandedMixins ?? EmptyArray;
_restrictions = restrictions;
_weakSelf = new WeakReference(this);
Version = new VersionHandle(Interlocked.Increment(ref _globalMethodVersion));
Version.SetName(name);
Id = Interlocked.Increment(ref _globalModuleId);
}