diff options
| author | eileencodes <eileencodes@gmail.com> | 2024-01-03 14:23:44 -0500 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-01-17 10:57:19 -0500 |
| commit | 78ad91f83f1c16318b2d3e5920c6ad98f88a4955 (patch) | |
| tree | 023ddd92b0aac8ea0c540e154b60dd8348b25fda /test/ruby/test_method_cache.rb | |
| parent | 03645d1eefdf280c3c1ff20f9431fb8fe45799b4 (diff) | |
[Prism] Fix more method call argumnents
In #2087 it was noted that there was a bug in the number of arguments in
`SplatNode` and `KeywordHashNode`. I looked into this with Aaron before
the linked PR was merged and we found a bunch of cases that weren't
working quite right. This PR aims to fix some of those cases, but there
may be more.
A splat argument followed by a positional argument will concat the array
until the end or unless the argument is a kwarg or splat kwarg. For
example
```
foo(a, *b, c, *d, e)
```
Will have an `argc` of 2, because `b`, `c`, `d`, and `e` will be
concatenated together.
```
foo(a, *b, c, *d, **e)
```
Will have an `argc` of 3, because `b`, `c`, and `d` will be concatenated
together and `e` is a separate argument.
Diffstat (limited to 'test/ruby/test_method_cache.rb')
0 files changed, 0 insertions, 0 deletions
