mruby/mruby — pull request #11 by shugo (2012-04-20 07:59:01+00:00)
Title: The class of a module should not be Class

I've found that the following code causes SEGV:

module X
end
X.new

It's because mrb_module_new() calls make_metaclass(), and thus the class of a module is Class, not Module, in mruby:

module X
end
p X.class #=> Class

I think modules should not have metaclasses because there is no need to inherit singleton methods of superclasses.