lib/spoom/deadcode/plugins/namespaces.rb in spoom-1.2.4 vs lib/spoom/deadcode/plugins/namespaces.rb in spoom-1.3.0
- old
+ new
@@ -20,14 +20,12 @@
private
sig { params(indexer: Indexer).returns(T::Boolean) }
def used_as_namespace?(indexer)
node = indexer.current_node
- return false unless node.is_a?(SyntaxTree::ClassDeclaration) || node.is_a?(SyntaxTree::ModuleDeclaration)
+ return false unless node.is_a?(Prism::ClassNode) || node.is_a?(Prism::ModuleNode)
- node.bodystmt.statements.body.any? do |stmt|
- !stmt.is_a?(SyntaxTree::VoidStmt)
- end
+ !!node.body
end
end
end
end
end