diff options
| author | Ufuk Kayserilioglu <ufuk.kayserilioglu@shopify.com> | 2024-06-26 17:38:01 -0400 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2026-02-15 14:12:15 -0500 |
| commit | 99674185d63162eadcded3d2623a181fddf2bbb3 (patch) | |
| tree | 0b2b62b3d5c9124b1fc9a9551850a3494de1fb3d /proc.c | |
| parent | 071c6d149b8e67960ba809089c3736926620c40e (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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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, ", "); |
