[ruby/prism] Do not warn for unused variables on negative lines

Fixes [Bug #20788]

27e91f21af
This commit is contained in:
Kevin Newton 2024-10-10 10:57:05 -04:00 committed by git
parent d12c8cbf14
commit b5ecb03ae4
2 changed files with 14 additions and 10 deletions

View file

@ -259,6 +259,8 @@ module Prism
refute_warning("def foo; bar = 1; tap { bar }; end")
refute_warning("def foo; bar = 1; tap { baz = bar; baz }; end")
refute_warning("def foo; bar = 1; end", line: -2, compare: false)
end
def test_void_statements