1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core
Jeremy Evans f53dfab95c Add support for anonymous rest and keyword rest argument forwarding
This allows for the following syntax:

```ruby
def foo(*)
  bar(*)
end
def baz(**)
  quux(**)
end
```

This is a natural addition after the introduction of anonymous
block forwarding.  Anonymous rest and keyword rest arguments were
already supported in method parameters, this just allows them to
be used as arguments to other methods.  The same advantages of
anonymous block forwarding apply to rest and keyword rest argument
forwarding.

This has some minor changes to #parameters output.  Now, instead
of `[:rest], [:keyrest]`, you get `[:rest, :*], [:keyrest, :**]`.
These were already used for `...` forwarding, so I think it makes
it more consistent to include them in other cases.  If we want to
use `[:rest], [:keyrest]` in both cases, that is also possible.

I don't think the previous behavior of `[:rest], [:keyrest]` in
the non-... case and `[:rest, :*], [:keyrest, :**]` in the ...
case makes sense, but if we did want that behavior, we'll have to
make more substantial changes, such as using a different ID in the
... forwarding case.

Implements [Feature #18351]
2021-12-30 14:37:42 -08:00
..
argf
array Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
basicobject Update to ruby/spec@37e52e5 2021-02-27 13:00:26 +01:00
binding Update to ruby/spec@d6921ef 2021-10-20 21:41:46 +02:00
builtin_constants
class Remove Class#descendants 2021-12-20 11:02:15 -08:00
comparable
complex Fix typos 2021-11-02 19:17:37 +09:00
conditionvariable Update to ruby/spec@d6921ef 2021-10-20 21:41:46 +02:00
data
dir Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
encoding Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
enumerable Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
enumerator Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
env Update to ruby/spec@d6921ef 2021-10-20 21:41:46 +02:00
exception Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
false
fiber Update to ruby/spec@21a48d9 2021-10-28 18:54:01 +02:00
file Update to ruby/spec@254c380 2021-10-20 21:57:05 +02:00
filetest
float Update to ruby/spec@d6921ef 2021-10-20 21:41:46 +02:00
gc Fix GC.total_time example 2021-11-30 08:49:41 +09:00
hash Update to ruby/spec@d6921ef 2021-10-20 21:41:46 +02:00
integer s/an Bignum/a Bignum/ [ci skip] 2021-12-28 18:35:03 +09:00
io Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
kernel Restore the global random seed 2021-12-16 17:44:12 +09:00
main Make Module#{public,private,protected,module_function} return arguments 2021-11-18 09:47:40 -08:00
marshal Update to ruby/spec@ccf0d85 2021-10-05 19:41:44 +02:00
matchdata Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
math
method Add support for anonymous rest and keyword rest argument forwarding 2021-12-30 14:37:42 -08:00
module Remove Refinement#include and Refinement#prepend 2021-12-26 23:28:54 +09:00
mutex
nil Update to ruby/spec@b65d01f 2021-07-29 22:11:21 +02:00
numeric Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
objectspace Update to ruby/spec@ccf0d85 2021-10-05 19:41:44 +02:00
proc Add support for anonymous rest and keyword rest argument forwarding 2021-12-30 14:37:42 -08:00
process Update to ruby/spec@b1e93a2 2021-09-07 19:01:07 +02:00
queue
random Update to ruby/spec@21a48d9 2021-10-28 18:54:01 +02:00
range Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
rational Update to ruby/spec@b1e93a2 2021-09-07 19:01:07 +02:00
regexp Update to ruby/spec@37e52e5 2021-02-27 13:00:26 +01:00
signal Update to ruby/spec@a0b7d0d 2021-06-02 14:34:07 +02:00
sizedqueue
string Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
struct Fix typos 2021-11-02 19:17:37 +09:00
symbol Update to ruby/spec@21a48d9 2021-10-28 18:54:01 +02:00
systemexit
thread Update to ruby/spec@21a48d9 2021-10-28 18:54:01 +02:00
threadgroup
time Update to ruby/spec@b65d01f 2021-07-29 22:11:21 +02:00
tracepoint Update to ruby/spec@b1e93a2 2021-09-07 19:01:07 +02:00
true
unboundmethod
warning Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00