summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-01-05 16:12:31 -0800
committerJeremy Evans <code@jeremyevans.net>2022-01-06 08:03:33 -0800
commita79c59472df38297c246b27713c277f2edaefa7a (patch)
tree8e048103810370901f8ad6bcc37893978c933120 /object.c
parent73be7a85cd4da6229f9a898b77492357e3811210 (diff)
Allow include before calling Module#initialize
This is to allow Module subclasses that include modules before calling super in the subclass's initialize. Remove rb_module_check_initializable from Module#initialize. Module#initialize only calls module_exec if a block is passed, it doesn't have other issues that would cause problems if called multiple times or with an already initialized module. Move initialization of super to Module#allocate, though I'm not sure it is required there. However, it's needed to be removed from Module#initialize for this to work. Fixes [Bug #18292]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5398
Diffstat (limited to 'object.c')
-rw-r--r--object.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/object.c b/object.c
index 2c9cbe7403..9243df5587 100644
--- a/object.c
+++ b/object.c
@@ -1689,7 +1689,6 @@ static VALUE rb_mod_initialize_exec(VALUE module);
static VALUE
rb_mod_initialize(VALUE module)
{
- rb_module_check_initializable(module);
return rb_mod_initialize_exec(module);
}