# frozen_string_literal: true module RuboCop module Cop module Style # Enforces the use of `Array()` instead of explicit `Array` check or `[*var]`. # # The cop is disabled by default due to safety concerns. # # @safety # This cop is unsafe because a false positive may occur if # the argument of `Array()` is (or could be) nil or depending # on how the argument is handled by `Array()` (which can be # different than just wrapping the argument in an array). # # For example: # # [source,ruby] # ---- # [nil] #=> [nil] # Array(nil) #=> [] # # [{a: 'b'}] #= [{a: 'b'}] # Array({a: 'b'}) #=> [[:a, 'b']] # # [Time.now] #=> [#