From 26f8f27b3c75253e739f4106d1f389846cb72512 Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Wed, 2 Aug 2023 22:49:39 +0800 Subject: [PATCH] formulary: fix type of `alias_path` `Formulary.from_rack` only allows `alias_path` to be a `Pathname`. Make it happy with `String`s too. Fixes: $ brew test openssl Error: Parameter 'alias_path': Expected type Pathname, got type String with value "/usr/local/Homebrew/Librar...homebrew-core/Aliases/openssl" Caller: /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/sorbet-runtime-0.5.10461/lib/types/private/methods/call_validation.rb:113 Definition: /usr/local/Homebrew/Library/Homebrew/formulary.rb:787 Signed-off-by: Ruoyu Zhong --- Library/Homebrew/formulary.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index bcc7e313f0..cd014e72f3 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -779,7 +779,7 @@ module Formulary rack: Pathname, # Automatically resolves the formula's spec if not specified. spec: Symbol, - alias_path: Pathname, + alias_path: T.any(Pathname, String), force_bottle: T::Boolean, flags: T::Array[String], ).returns(Formula) @@ -819,7 +819,7 @@ module Formulary keg: Keg, # Automatically resolves the formula's spec if not specified. spec: Symbol, - alias_path: Pathname, + alias_path: T.any(Pathname, String), force_bottle: T::Boolean, flags: T::Array[String], ).returns(Formula)