internal RubyClass/*!*/ CreateSingletonClass(RubyClass/*!*/ superClass, Action<RubyModule> trait) {
// Note that in MRI, member tables of dummy singleton are shared with the class the dummy is singleton for
// This is obviously an implementation detail leaking to the language and we don't support that.
// real class object and it's singleton share the tracker:
TypeTracker tracker = (IsSingletonClass) ? null : _typeTracker;
// Singleton should have the same restrictions as the module it is singleton for.
// Reason: We need static methods of builtins (e.g. Object#Equals) not to be exposed under Ruby names (Object#equals).
// We also want static methods of non-builtins to be visible under both CLR and Ruby names.
var result = new RubyClass(
Context, null, null, this, trait, null, null, superClass, null, tracker, null, false, true, this.Restrictions
);
#if DEBUG
result.Version.SetName(result.DebugName);
#endif
return result;
}