diff --git a/Library/Homebrew/sorbet/tapioca/compilers/env_config.rb b/Library/Homebrew/sorbet/tapioca/compilers/env_config.rb index 5a17cdaa22..c57ff4a113 100644 --- a/Library/Homebrew/sorbet/tapioca/compilers/env_config.rb +++ b/Library/Homebrew/sorbet/tapioca/compilers/env_config.rb @@ -23,13 +23,13 @@ module Tapioca next if Homebrew::EnvConfig::CUSTOM_IMPLEMENTATIONS.include?(env) name = Homebrew::EnvConfig.env_method_name(env, hash) - dynamic_methods[name] = { default: hash[:default] } + dynamic_methods[name] = hash[:default] end - dynamic_methods.each_key do |method| + dynamic_methods.each do |method, default| return_type = if method.end_with?("?") T::Boolean - elsif (default = dynamic_methods[method][:default]) + elsif default default.class else T.nilable(String)