From da8a062cfce4e61b61717de1497df5ff9849d42d Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 31 Jul 2023 11:31:35 -0700 Subject: [PATCH] Widen paths type in Formula#inreplace --- Library/Homebrew/formula.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fb35642ae8..664e282006 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2556,7 +2556,7 @@ class Formula # @api public sig { params( - paths: T.any(T::Array[T.untyped], String, Pathname), + paths: T.any(T::Enumerable[T.untyped], String, Pathname), before: T.nilable(T.any(Pathname, Regexp, String)), after: T.nilable(T.any(Pathname, String, Symbol)), audit_result: T::Boolean, @@ -2566,8 +2566,7 @@ class Formula super(paths, before, after, audit_result) rescue Utils::Inreplace::Error => e onoe e.to_s - args = paths.is_a?(Array) ? paths : [paths] - raise BuildError.new(self, "inreplace", args, {}) + raise BuildError.new(self, "inreplace", Array(paths), {}) end protected