mirror of
https://github.com/ruby/ruby.git
synced 2026-10-29 00:46:26 +08:00
Do not use ruby2_keywords for ... argument forwarding
This allows ... argument forwarding to benefit from Allocationless
Anonymous Splat Forwarding, allowing the `f` call below to not
allocate an array or a hash.
```ruby
a = [1]
kw = {b: 2}
def c(a, b:)
end
def f(...)
c(...)
end
f(*a, **kw)
```
This temporarily skips prism locals tests until prism is changed
to use * and ** for ..., instead of using ruby2_keywords.
Ignore failures in rbs bundled gems tests, since they fail due
to this change.
This commit is contained in:
1 parent
0f90a24a81
commit
4f77d8d328
5 files changed
+4
-4
No files matched your search
@@ -99,7 +99,7 @@ jobs:
|
||||
env:
|
||||
RUBY_TESTOPTS: '-q --tty=no'
|
||||
TESTS: ${{ matrix.test_task == 'check' && matrix.skipped_tests || '' }}
|
||||
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'typeprof'
|
||||
TEST_BUNDLED_GEMS_ALLOW_FAILURES: 'rbs,typeprof'
|
||||
PRECHECK_BUNDLED_GEMS: 'no'
|
||||
|
||||
- name: make skipped tests
|
||||
|
||||
@@ -1627,7 +1627,6 @@ static void numparam_pop(struct parser_params *p, NODE *prev_inner);
|
||||
#else
|
||||
#define arg_FWD_BLOCK idFWD_BLOCK
|
||||
#endif
|
||||
#define FORWARD_ARGS_WITH_RUBY2_KEYWORDS
|
||||
|
||||
#define RE_OPTION_ONCE (1<<16)
|
||||
#define RE_OPTION_ENCODING_SHIFT 8
|
||||
|
||||
@@ -83,7 +83,7 @@ module Prism
|
||||
|
||||
filepath = File.join(base, relative)
|
||||
define_method("test_#{relative}") { assert_locals(filepath) }
|
||||
end
|
||||
end if false # skip until ... uses * and ** and not ruby2_keywords
|
||||
|
||||
def setup
|
||||
@previous_default_external = Encoding.default_external
|
||||
|
||||
@@ -11,6 +11,7 @@ module Prism
|
||||
|
||||
filepaths.each do |relative|
|
||||
define_method("test_newline_flags_#{relative}") do
|
||||
next if relative == 'locals_test.rb'
|
||||
assert_newlines(base, relative)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -661,7 +661,7 @@ class TestAst < Test::Unit::TestCase
|
||||
node ? [node.children[-4], node.children[-2]&.children, node.children[-1]] : []
|
||||
end
|
||||
|
||||
assert_equal([:*, nil, :&], forwarding.call('...'))
|
||||
assert_equal([:*, [:**], :&], forwarding.call('...'))
|
||||
end
|
||||
|
||||
def test_ranges_numbered_parameter
|
||||
|
||||
Reference in new issue
Block a user