summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-04-10 22:44:33 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-04-11 12:03:55 +0900
commit207788466eedfdefcf09fdc5c6217547b5ce4ed1 (patch)
treee4bc9ebfe2e330f62f90473be14320baf26e6431 /test/ruby
parent5d9fd674c9ceefd6baffdd05d33c5b60a7c64e42 (diff)
[Bug #20417] Block local variables do not need to warn about unused
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_ast.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 90d19c3d68..29da607fc5 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -1232,6 +1232,12 @@ dummy
EXP
end
+ def test_unused_block_local_variable
+ assert_warning('') do
+ RubyVM::AbstractSyntaxTree.parse(%{->(; foo) {}})
+ end
+ end
+
def assert_error_tolerant(src, expected, keep_tokens: false)
begin
verbose_bak, $VERBOSE = $VERBOSE, false