Fix type errors.

This commit is contained in:
Markus Reiter 2023-05-01 08:08:19 +02:00
parent fe19ddc3a7
commit ff71668f0a
No known key found for this signature in database
GPG Key ID: 245293B51702655B
2 changed files with 2 additions and 2 deletions

View File

@ -974,7 +974,7 @@ module Homebrew
end end
end end
res_current = resource.version res_current = T.must(resource.version)
res_latest = Version.new(match_version_map.values.max_by { |v| LivecheckVersion.create(resource, v) }) res_latest = Version.new(match_version_map.values.max_by { |v| LivecheckVersion.create(resource, v) })
return status_hash(resource, "error", ["Unable to get versions"], verbose: verbose) if res_latest.blank? return status_hash(resource, "error", ["Unable to get versions"], verbose: verbose) if res_latest.blank?

View File

@ -194,7 +194,7 @@ class Resource < Downloadable
def version(val = nil) def version(val = nil)
return super() if val.nil? return super() if val.nil?
@version = case val @version = case T.unsafe(val)
when String when String
val.blank? ? Version::NULL : Version.new(val) val.blank? ? Version::NULL : Version.new(val)
when Version when Version