From 33d9dc63b06e46fc9cf2e3487914ffda3f02322d Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Tue, 18 Jul 2023 10:22:51 -0700 Subject: [PATCH 1/2] Fix type errors when HOMEBREW_SORBET_RUNTIME=1 --- Library/Homebrew/dev-cmd/generate-cask-api.rb | 1 + Library/Homebrew/version.rb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/dev-cmd/generate-cask-api.rb b/Library/Homebrew/dev-cmd/generate-cask-api.rb index cb092edba7..6ad4f38ff6 100644 --- a/Library/Homebrew/dev-cmd/generate-cask-api.rb +++ b/Library/Homebrew/dev-cmd/generate-cask-api.rb @@ -3,6 +3,7 @@ require "cli/parser" require "cask/cask" +require "formula" module Homebrew module_function diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 3157d40b75..b188deb003 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -711,9 +711,9 @@ class Version T.must(version).to_str end - sig { params(options: Hash).returns(String) } - def to_json(**options) - version.to_json(**options) + sig { params(options: T.untyped).returns(String) } + def to_json(*options) + version.to_json(*options) end sig { params(method: T.any(Symbol, String), include_all: T::Boolean).returns(T::Boolean) } From 368dd4d94934f873b1fab5d171b12fd32a80fca0 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Tue, 18 Jul 2023 11:30:46 -0700 Subject: [PATCH 2/2] Fix other to_json override while we're here --- Library/Homebrew/cask/config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/config.rb b/Library/Homebrew/cask/config.rb index 706ab32300..ae3533e7a8 100644 --- a/Library/Homebrew/cask/config.rb +++ b/Library/Homebrew/cask/config.rb @@ -194,12 +194,12 @@ module Cask end sig { params(options: T.untyped).returns(String) } - def to_json(**options) + def to_json(*options) { default: default, env: env, explicit: explicit, - }.to_json(**options) + }.to_json(*options) end end end