UnusedArgument: fix crystal upgrade regression

This commit is contained in:
Vitalii Elenhaupt 2018-12-12 22:21:33 +02:00
parent f671d6f857
commit 60ce034f1b
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
2 changed files with 18 additions and 0 deletions

View file

@ -154,6 +154,19 @@ module Ameba::Rule::Lint
subject.catch(s).should be_valid
end
it "doesn't report if enum in a record" do
s = Source.new %(
class Class
record Record do
enum Enum
CONSTANT
end
end
end
)
subject.catch(s).should be_valid
end
context "super" do
it "reports if variable is not referenced implicitly by super" do
s = Source.new %(

View file

@ -45,6 +45,11 @@ module Ameba::AST
on_scope_enter(node)
end
# :nodoc:
def visit(node : Crystal::EnumDef)
on_scope_enter(node)
end
# :nodoc:
def visit(node : Crystal::LibDef)
on_scope_enter(node)