summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parse.y2
-rw-r--r--test/ruby/test_ast.rb2
-rw-r--r--test/ruby/test_syntax.rb2
3 files changed, 4 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index a69a7bea55..f5f8e15acf 100644
--- a/parse.y
+++ b/parse.y
@@ -5612,7 +5612,7 @@ f_kwrest : kwrest_mark tIDENTIFIER
{
arg_var(p, ANON_KEYWORD_REST_ID);
/*%%%*/
- $$ = internal_id(p);
+ $$ = ANON_KEYWORD_REST_ID;
/*% %*/
/*% ripper: kwrest_param!(Qnil) %*/
}
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 0932e93d5a..7af6e43e1d 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -469,7 +469,7 @@ class TestAst < Test::Unit::TestCase
end
assert_equal(nil, kwrest.call(''))
- assert_equal([nil], kwrest.call('**'))
+ assert_equal([:**], kwrest.call('**'))
assert_equal(false, kwrest.call('**nil'))
assert_equal([:a], kwrest.call('**a'))
end
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index b0ad012131..7a5f4c9528 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -163,9 +163,11 @@ class TestSyntax < Test::Unit::TestCase
def c(**kw); kw end
def d(**); b(k: 1, **) end
def e(**); b(**, k: 1) end
+ def f(a: nil, **); b(**) end
assert_equal({a: 1, k: 3}, b(a: 1, k: 3))
assert_equal({a: 1, k: 3}, d(a: 1, k: 3))
assert_equal({a: 1, k: 1}, e(a: 1, k: 3))
+ assert_equal({k: 3}, f(a: 1, k: 3))
end;
end