From d1892d436af2be2f3196f567354f4eb3a27ff071 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sat, 5 Oct 2024 23:25:09 +0100 Subject: [PATCH] Fix leftover errors for `Dependencies` vs. `T::Array[Dependency]` --- Library/Homebrew/dependencies.rb | 5 +++++ Library/Homebrew/formula_cellar_checks.rb | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 3e8bd125e8..354b12745e 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -39,6 +39,11 @@ class Dependencies < SimpleDelegator def inspect "#<#{self.class.name}: #{__getobj__}>" end + + sig { returns(T::Array[Dependency]) } + def to_a + __getobj__.to_a + end end # A collection of requirements. diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 93cf4b9d7e..26e4f2f066 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -191,7 +191,7 @@ module FormulaCellarChecks EOS end - sig { params(lib: Pathname, deps: T::Array[Dependency]).returns(T.nilable(String)) } + sig { params(lib: Pathname, deps: Dependencies).returns(T.nilable(String)) } def check_python_packages(lib, deps) return unless lib.directory? @@ -209,7 +209,8 @@ module FormulaCellarChecks return if pythons.blank? - python_deps = deps.map(&:name) + python_deps = deps.to_a + .map(&:name) .grep(/^python(@.*)?$/) .filter_map { |d| Formula[d].version.to_s[/^\d+\.\d+/] }