mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
UnusedArgument: fix crystal upgrade regression
This commit is contained in:
parent
f671d6f857
commit
60ce034f1b
2 changed files with 18 additions and 0 deletions
|
@ -154,6 +154,19 @@ module Ameba::Rule::Lint
|
||||||
subject.catch(s).should be_valid
|
subject.catch(s).should be_valid
|
||||||
end
|
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
|
context "super" do
|
||||||
it "reports if variable is not referenced implicitly by super" do
|
it "reports if variable is not referenced implicitly by super" do
|
||||||
s = Source.new %(
|
s = Source.new %(
|
||||||
|
|
|
@ -45,6 +45,11 @@ module Ameba::AST
|
||||||
on_scope_enter(node)
|
on_scope_enter(node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# :nodoc:
|
||||||
|
def visit(node : Crystal::EnumDef)
|
||||||
|
on_scope_enter(node)
|
||||||
|
end
|
||||||
|
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
def visit(node : Crystal::LibDef)
|
def visit(node : Crystal::LibDef)
|
||||||
on_scope_enter(node)
|
on_scope_enter(node)
|
||||||
|
|
Loading…
Reference in a new issue