diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 9c2cc6908b..24d5c83143 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2632,9 +2632,9 @@ class Formula block: T.nilable( T.proc.params( arg0: T.any(Formula, CaskDependent), - arg1: Dependency - ).returns(T.nilable(Symbol)) - ) + arg1: Dependency, + ).returns(T.nilable(Symbol)), + ), ).returns(T::Array[Dependency]) } def recursive_dependencies(&block) @@ -2651,14 +2651,15 @@ class Formula # The full set of {Requirements} for this formula's dependency tree. # # @api internal - sig { + T::Sig::WithoutRuntime.sig { + # CaskDependent may not be initialized yet, so we don't use a runtime sig params( block: T.nilable( T.proc.params( arg0: T.any(Formula, CaskDependent, SoftwareSpec), - arg1: Requirement - ).returns(T.nilable(Symbol)) - ) + arg1: Requirement, + ).returns(T.nilable(Symbol)), + ), ).returns(Requirements) } def recursive_requirements(&block) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index c819e9f2e6..9424e46e85 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -736,6 +736,7 @@ on_request: installed_on_request?, options:) next Dependable::PRUNE else unsatisfied_reqs[dependent] << req + nil # Return nil to satisfy T.nilable(Symbol) block sig (Array from << would violate it). end end end