diff --git a/src/ameba/ast/variabling/variable.cr b/src/ameba/ast/variabling/variable.cr index 5380d8fa..8b513948 100644 --- a/src/ameba/ast/variabling/variable.cr +++ b/src/ameba/ast/variabling/variable.cr @@ -72,6 +72,11 @@ module Ameba::AST end end + # :ditto: + def reference(scope : Scope) + reference(node, scope) + end + # Reference variable's assignments. # # ``` diff --git a/src/ameba/ast/visitors/scope_visitor.cr b/src/ameba/ast/visitors/scope_visitor.cr index a7f132db..53ea39eb 100644 --- a/src/ameba/ast/visitors/scope_visitor.cr +++ b/src/ameba/ast/visitors/scope_visitor.cr @@ -178,9 +178,7 @@ module Ameba::AST when scope.type_definition? && accessor_macro?(node) then return false when scope.def? && special_node?(node) scope.arguments.each do |arg| - variable = arg.variable - - ref = variable.reference(variable.node, scope) + ref = arg.variable.reference(scope) ref.explicit = false end end