module RuboCop::Cop::Util
def any_descendant?(node, *types)
def any_descendant?(node, *types) if block_given? node.each_descendant(*types) do |descendant| return true if yield(descendant) end else # Use a block version to avoid allocating enumerators. node.each_descendant do # rubocop:disable Lint/UnreachableLoop return true end end false end