Skip to content

Commit

Permalink
Update unused_generic_or_union.cr
Browse files Browse the repository at this point in the history
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
  • Loading branch information
nobodywasishere and Sija authored Jan 27, 2025
1 parent 2e7b83f commit 3c28b2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ameba/rule/lint/unused_generic_or_union.cr
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ module Ameba::Rule::Lint
issue_for node, GENERIC_MSG unless node_is_used
end

private def path_or_generic_union?(node : Crystal::Call)
node.name == "|" && node.args.size == 1 && (obj = node.obj) &&
private def path_or_generic_union?(node : Crystal::Call) : Bool
node.name == "|" && node.args.size == 1 && !!(obj = node.obj) &&
valid_type_node?(obj) && valid_type_node?(node.args.first)
end

Expand Down

0 comments on commit 3c28b2b

Please sign in to comment.