Skip to content

Commit

Permalink
Merge pull request #1732 from Shopify/vs/handle_new_identity_comparis…
Browse files Browse the repository at this point in the history
…on_hashes

Account for new identity comparison hashes in Sorbet internals
  • Loading branch information
vinistock committed Dec 15, 2023
2 parents 5673e5f + 4dddb17 commit 2e4ab6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,14 @@ GEM
rack (>= 2.2.4)
redis-client (>= 0.14.0)
smart_properties (1.17.0)
sorbet (0.5.11150)
sorbet-static (= 0.5.11150)
sorbet-runtime (0.5.11150)
sorbet-static (0.5.11150-universal-darwin)
sorbet-static (0.5.11150-x86_64-linux)
sorbet-static-and-runtime (0.5.11150)
sorbet (= 0.5.11150)
sorbet-runtime (= 0.5.11150)
sorbet (0.5.11155)
sorbet-static (= 0.5.11155)
sorbet-runtime (0.5.11155)
sorbet-static (0.5.11155-universal-darwin)
sorbet-static (0.5.11155-x86_64-linux)
sorbet-static-and-runtime (0.5.11155)
sorbet (= 0.5.11155)
sorbet-runtime (= 0.5.11155)
spoom (1.2.4)
erubi (>= 1.10.0)
sorbet-static-and-runtime (>= 0.5.10187)
Expand Down
6 changes: 5 additions & 1 deletion lib/tapioca/gem/listeners/sorbet_signatures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def compile_signature(signature, parameters)
sig { params(signature: T.untyped).returns(T::Boolean) }
def signature_final?(signature)
modules_with_final = T::Private::Methods.instance_variable_get(:@modules_with_final)
final_methods = modules_with_final[signature.owner.object_id]
final_methods = if sorbet_supports?(:identity_comparison)
modules_with_final[signature.owner]
else
modules_with_final[signature.owner.object_id]
end

return false unless final_methods

Expand Down
1 change: 1 addition & 0 deletions lib/tapioca/helpers/sorbet_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module SorbetHelper
# feature_name: ::Gem::Requirement.new(">= ___"), # https://github.com/sorbet/sorbet/pull/___
non_generic_weak_map: ::Gem::Requirement.new(">= 0.5.10587"), # https://github.com/sorbet/sorbet/pull/6610
generic_class: ::Gem::Requirement.new(">= 0.5.10820"), # https://github.com/sorbet/sorbet/pull/6781
identity_comparison: ::Gem::Requirement.new(">= 0.5.11155"), # https://github.com/sorbet/sorbet/pull/7531
}.freeze,
T::Hash[Symbol, ::Gem::Requirement],
)
Expand Down

0 comments on commit 2e4ab6f

Please sign in to comment.