diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-26 08:25:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-26 08:25:48 +0000 |
commit | eab191040e9356a8ed4aaa418a7904d6f94064b9 (patch) | |
tree | d3b3b15e3f380c272e855cd320506d51296d7620 /test/ruby/test_syntax.rb | |
parent | c7855be25c379206a1bddd2bbd76e11cc642c8f8 (diff) | |
download | ruby-eab191040e9356a8ed4aaa418a7904d6f94064b9.tar.gz |
parse.y: fix invalid keyword argument
* parse.y (f_label, f_kw, formal_argument_gen): ignore invalid
formal argument in keyword argument definition.
[ruby-dev:48742] [Bug #10545]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r-- | test/ruby/test_syntax.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 00e21606c6..d36cbb0638 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -530,6 +530,12 @@ eom assert_syntax_error(code, /def n "\u{2208}"; end/, bug10114) end + def test_bad_kwarg + bug10545 = '[ruby-dev:48742] [Bug #10545]' + src = 'def foo(A: a) end' + assert_syntax_error(src, /formal argument/, bug10545) + end + private def not_label(x) @result = x; @not_label ||= nil end |