Incorporate changes for shadowing outer local var

This commit is contained in:
Vitalii Elenhaupt 2023-02-04 20:40:59 +02:00
parent ddbcf5cb3f
commit 14a9ec3a75
No known key found for this signature in database
GPG key ID: CD0BF17825928BC0
6 changed files with 64 additions and 1 deletions

View file

@ -136,6 +136,19 @@ module Ameba::Rule::Lint
CRYSTAL
end
it "doesn't report if it shadows type definition" do
expect_no_issues subject, <<-CRYSTAL
class FooBar
getter index : String
def bar
3.times do |index|
end
end
end
CRYSTAL
end
it "doesn't report if it shadows throwaway arguments" do
expect_no_issues subject, <<-CRYSTAL
data = [{1, "a"}, {2, "b"}, {3, "c"}]