From 2809678f7762e20ba332bf92a5ad6b1e289bbada Mon Sep 17 00:00:00 2001 From: Shu Niu Date: Mon, 6 Nov 2023 14:08:41 +0800 Subject: [PATCH] Fix TypeError with gcc compiler in deprecated MacOS In some deprecated MacOS, e.g.10.13 High Sierra, when compiling formulae with --cc=gcc-XX, homebrew will raise "TypeError: Return value: Expected type Symbol, got type String with value". Convert "other" string to symbol to solve this. --- Library/Homebrew/extend/ENV/shared.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index fb25328cf7..02d424dee0 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -348,7 +348,7 @@ module SharedEnvExtension COMPILER_SYMBOL_MAP.fetch(value) do |other| case other when GNU_GCC_REGEXP - other + other.to_sym else raise "Invalid value for #{source}: #{other}" end