Do not treat paths as literals in Lint/LiteralAssignmentsInExpressions

This commit is contained in:
Sijawusz Pur Rahnama 2022-12-08 14:16:38 +01:00
parent 1261f4ba6d
commit 0bd4ed0c45

View file

@ -35,7 +35,7 @@ module Ameba::Rule::Lint
def test(source, node : Crystal::If | Crystal::Unless | Crystal::Case | Crystal::While | Crystal::Until)
return unless (cond = node.cond).is_a?(Crystal::Assign)
return unless literal?(cond.value, include_paths: true)
return unless literal?(cond.value)
issue_for cond, MSG
end