summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorUfuk Kayserilioglu <ufuk.kayserilioglu@shopify.com>2024-06-26 17:38:01 -0400
committerKevin Newton <kddnewton@gmail.com>2026-02-15 14:12:15 -0500
commit99674185d63162eadcded3d2623a181fddf2bbb3 (patch)
tree0b2b62b3d5c9124b1fc9a9551850a3494de1fb3d /proc.c
parent071c6d149b8e67960ba809089c3736926620c40e (diff)
Start handling `&nil` in method parameters
Similar to `:nokey` for `**nil` declaring methods/procs, a method/proc with a `&nil` declaration will return a `:noblock` entry in the parameters array.
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 67963a1b01..3e2afeab3c 100644
--- a/proc.c
+++ b/proc.c
@@ -3433,6 +3433,7 @@ method_inspect(VALUE method)
const VALUE keyrest = ID2SYM(rb_intern("keyrest"));
const VALUE block = ID2SYM(rb_intern("block"));
const VALUE nokey = ID2SYM(rb_intern("nokey"));
+ const VALUE noblock = ID2SYM(rb_intern("noblock"));
int forwarding = 0;
rb_str_buf_cat2(str, "(");
@@ -3467,6 +3468,9 @@ method_inspect(VALUE method)
else if (kind == nokey) {
name = rb_str_new2("nil");
}
+ else if (kind == noblock) {
+ name = rb_str_new2("nil");
+ }
else {
name = Qnil;
}
@@ -3519,6 +3523,9 @@ method_inspect(VALUE method)
else if (kind == nokey) {
rb_str_buf_cat2(str, "**nil");
}
+ else if (kind == noblock) {
+ rb_str_buf_cat2(str, "&nil");
+ }
if (i < RARRAY_LEN(params) - 1) {
rb_str_buf_cat2(str, ", ");