From 75db3b8e2181e585b5919bfddc7e318ff93573b2 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sat, 30 Mar 2024 19:54:51 +0000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com> --- Library/Homebrew/sorbet/tapioca/compilers/env_config.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)