diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-11-06 12:45:11 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-11-06 12:45:11 +0900 |
commit | 2fd465540f6dacaf16a8b679b6da000e90845a00 (patch) | |
tree | 5fdf01878397637dc1ccd807ea49b022d00478d8 /test/ruby/test_syntax.rb | |
parent | 82e840ad15bba42b399a21de746967a731240ec2 (diff) | |
download | ruby-2fd465540f6dacaf16a8b679b6da000e90845a00.tar.gz |
Numbered parameter is an ID_LOCAL now [Bug #16293]
Diffstat (limited to 'test/ruby/test_syntax.rb')
-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'/) { |