Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils/bottles: fix typechecking error #15381

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/os/mac/utils/bottles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class << self
undef tag

def tag(symbol = nil)
return Utils::Bottles::Tag.from_symbol(symbol) if symbol.present?
return Utils::Bottles::Tag.from_symbol(symbol.to_sym) if symbol.present?

Utils::Bottles::Tag.new(system: MacOS.version.to_sym, arch: Hardware::CPU.arch)
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/bottles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Bottles
class << self
# Gets the tag for the running OS.
def tag(symbol = nil)
return Tag.from_symbol(symbol) if symbol.present?
return Tag.from_symbol(symbol.to_sym) if symbol.present?
Comment on lines 13 to +14
Copy link
Member

@Bo98 Bo98 May 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this should be fixed a level higher. The parameter is literally called "symbol" so should be a symbol.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that too (in part because I thought that might be able to fix it in one place instead of two), but I can't follow the call stack from the Sorbet error message. Happy to take a suggestion or replacement PR with a nicer fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nvm, I got it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was marked as duplicate.


@tag ||= Tag.new(system: HOMEBREW_SYSTEM.downcase.to_sym,
arch: HOMEBREW_PROCESSOR.downcase.to_sym)
Expand Down