From: "nobu (Nobuyoshi Nakada) via ruby-core" Date: 2026-01-13T06:09:29+00:00 Subject: [ruby-core:124499] [Ruby Feature#21813] Add [:forward, :...] symbol tuple to indicate forwarding arguments when calling `Method#parameters` Issue #21813 has been updated by nobu (Nobuyoshi Nakada). `foo(a: 1)` doesn't print what you expect, I guess. ---------------------------------------- Feature #21813: Add [:forward, :...] symbol tuple to indicate forwarding arguments when calling `Method#parameters` https://bugs.ruby-lang.org/issues/21813#change-116057 * Author: pabloh (Pablo Herrero) * Status: Open ---------------------------------------- When accessing `Method#parameters` for a method using forwarding parameters, an unexpected behavior arises: ```ruby def foo(*, **, &) binding.eval "print(#{(method(__method__).parameters.dig(0,1))})" # Works fine end foo(1,2,3,4) # => 1234 def bar(...) binding.eval "print(#{(method(__method__).parameters.dig(0,1))})" # Fails! end bar(1,2,3,3) # SyntaxError ``` It's very strange that you can't access the parameters, on `eval`, using the symbols provided at `Method#parameters`. Adding `[:forward, :...]` or `[:forwarding, :...]` for those cases feels simply natural. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/