diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_syntax.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index b55e579062..ef1e24221e 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1455,6 +1455,7 @@ eom assert_syntax_error('->x=_1{}', /ordinary parameter is defined/) assert_syntax_error('-> {_1; -> {_2}}', /numbered parameter is already used/) assert_syntax_error('-> {-> {_1}; _2}', /numbered parameter is already used/) + assert_syntax_error('proc {_1; _1 = nil}', /Can't assign to numbered parameter _1/) assert_warn(/`_1' is used as numbered parameter/) {eval('proc {_1 = nil}')} assert_warn(/`_2' is used as numbered parameter/) {eval('_2=1')} assert_raise_with_message(NameError, /undefined local variable or method `_1'/) { |