Skip to content

Commit

Permalink
Combine cast / nilablecast
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Jan 29, 2025
1 parent 911dcab commit 1f86f8d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/ameba/ast/visitors/implicit_return_visitor.cr
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,7 @@ module Ameba::AST
false
end

def visit(node : Crystal::Cast)
@rule.test(@source, node, @stack.positive?)

incr_stack { node.obj.accept(self) }

false
end

def visit(node : Crystal::NilableCast) : Bool
def visit(node : Crystal::Cast | Crystal::NilableCast)
@rule.test(@source, node, @stack.positive?)

incr_stack { node.obj.accept(self) }
Expand Down

0 comments on commit 1f86f8d

Please sign in to comment.