sorbet-runtime 0.6.13367 → 0.6.13371

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f11b91971edf2b27dd1db52dd3c80c34684a88a2ab6b067cbbc3a7cd1349802
4
- data.tar.gz: dcd700ba9dbf2f724614f329fdbd2fcda8257c176fcd17f19b003c3047bd771a
3
+ metadata.gz: df752ebf8f7f9c90748d9df8dbc6e8fd1ccd2235734f027e3d8a884534291bc2
4
+ data.tar.gz: 6f9f13b4aca3e5a8d6be8ce41b50515a1102d3bf4010c89b2768faede6bdfaaa
5
5
  SHA512:
6
- metadata.gz: b6c006895941f19a3c173c4d39e677b10dcc1238375504fbb4e63ba5cd246751fbcbc3b43af30ded1b1c131659b1a071b7c7e198c24b3cea61798c533613f693
7
- data.tar.gz: c39536029f5950cf246b03140b5fcca4a34b8f897ad40aca9a48f9c8fa596e79b7636ce7030f25acd35da5e19e919171d62334dd2549c3e0026044f2c4e0fa2f
6
+ metadata.gz: 1b6d151be49e851cd4afb83665c681c524fe5204722194952852faa8d21da74e8fc296d1131c662eec5c43f7ceb8fcf0b46af47716d11977e8aee687e3dde0ff
7
+ data.tar.gz: cf4bfd7b7f6f8e5552bff3b5eb9bc99eccfaa8afb728b73ab2f62f21991c86628def1ba20efe6b09126d5bdcdc50456d0f7426fce48a991fd73b711dadf6763c
@@ -358,11 +358,22 @@ module T::Private::Methods
358
358
  key = method_owner_and_name_to_key(mod, method_name)
359
359
  T::Private::ClassUtils.replace_method(original_method, mod, method_name) do |*args, &blk|
360
360
  method_sig = T::Private::Methods.maybe_run_sig_block_for_key(key)
361
- method_sig ||= T::Private::Methods._handle_missing_method_signature(
362
- self,
363
- original_method,
364
- __callee__ || raise("Unknown __callee__ for method without a signature"),
365
- )
361
+ if !method_sig
362
+ callee = __callee__ || raise("Unknown __callee__ for method without a signature")
363
+ method_sig = T::Private::Methods.signature_for_method(original_method)
364
+ if !method_sig
365
+ raise "`sig` not present for method `#{callee}` on #{self.inspect} but you're trying to run it anyways. " \
366
+ "This should only be executed if you used `alias_method` to grab a handle to a method after `sig`ing it, but that clearly isn't what you are doing. " \
367
+ "Maybe look to see if an exception was thrown in your `sig` lambda or somehow else your `sig` wasn't actually applied to the method."
368
+ end
369
+
370
+ method_sig = T::Private::Methods._unwrap_alias(
371
+ method_sig,
372
+ self,
373
+ original_method,
374
+ callee,
375
+ )
376
+ end
366
377
 
367
378
  # Should be the same logic as CallValidation.wrap_method_if_needed but we
368
379
  # don't want that extra layer of indirection in the callstack
@@ -388,14 +399,8 @@ module T::Private::Methods
388
399
  end
389
400
  end
390
401
 
391
- def self._handle_missing_method_signature(receiver, original_method, callee)
392
- method_sig = T::Private::Methods.signature_for_method(original_method)
393
- if !method_sig
394
- raise "`sig` not present for method `#{callee}` on #{receiver.inspect} but you're trying to run it anyways. " \
395
- "This should only be executed if you used `alias_method` to grab a handle to a method after `sig`ing it, but that clearly isn't what you are doing. " \
396
- "Maybe look to see if an exception was thrown in your `sig` lambda or somehow else your `sig` wasn't actually applied to the method."
397
- end
398
-
402
+ # Only public so that it can be accessed in the closure for _on_method_added
403
+ def self._unwrap_alias(method_sig, receiver, original_method, callee)
399
404
  if receiver.class <= original_method.owner
400
405
  receiving_class = receiver.class
401
406
  elsif receiver.singleton_class <= original_method.owner
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.13367
4
+ version: 0.6.13371
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe