From 680bd9027f8cb7977bbc216609db2f4e3cf199a8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 3 Mar 2023 11:07:36 +0900 Subject: [Bug #19471] `Regexp.compile` should handle keyword arguments As well as `Regexp.new`, it should pass keyword arguments to the `Regexp#initialize` method. --- re.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 're.c') diff --git a/re.c b/re.c index 1f362247a0..83d4b09aa2 100644 --- a/re.c +++ b/re.c @@ -4688,7 +4688,7 @@ Init_Regexp(void) rb_cRegexp = rb_define_class("Regexp", rb_cObject); rb_define_alloc_func(rb_cRegexp, rb_reg_s_alloc); - rb_define_singleton_method(rb_cRegexp, "compile", rb_class_new_instance, -1); + rb_define_singleton_method(rb_cRegexp, "compile", rb_class_new_instance_pass_kw, -1); rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, 1); rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, 1); rb_define_singleton_method(rb_cRegexp, "union", rb_reg_s_union_m, -2); -- cgit v1.2.1