diff --git a/Library/Homebrew/utils/service.rb b/Library/Homebrew/utils/service.rb index ceb8cd36e2..3c13d75c70 100644 --- a/Library/Homebrew/utils/service.rb +++ b/Library/Homebrew/utils/service.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module Utils @@ -27,7 +27,7 @@ module Utils return @launchctl if defined? @launchctl return if ENV["HOMEBREW_TEST_GENERIC_OS"] - @launchctl = which("launchctl") + @launchctl = T.let(which("launchctl"), T.nilable(Pathname)) end # Path to systemctl binary. @@ -36,7 +36,7 @@ module Utils return @systemctl if defined? @systemctl return if ENV["HOMEBREW_TEST_GENERIC_OS"] - @systemctl = which("systemctl") + @systemctl = T.let(which("systemctl"), T.nilable(Pathname)) end sig { returns(T::Boolean) }