sorbet-runtime 0.5.5851 → 0.5.5855

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: c454cb15e39b7993b14f0351e090110a0f49b19f2fb851179699e1e70f87f9d2
4
- data.tar.gz: 37f92c032bd9af70232c7400549287cf9a026fb4137eeb7b1af23d95289e3286
3
+ metadata.gz: 05211daadd19374c8196176c89361938ef05fd1c5fa4c02f9e9d581bcf4114bf
4
+ data.tar.gz: 33f7feb752c822c281276f990b99c3ceeab66a4dd63359c00cfad66643680231
5
5
  SHA512:
6
- metadata.gz: 52989449f24b265c5612ed9916b107d0b81fb1565d6e70399f9f5d5b4bcf92c03b6cd6ecdbe9986cf8a4cead03b75a886ac133dcb076011e164cca15ebc464a9
7
- data.tar.gz: a4dc951f7c3572c7557870b57fdf5ef409c61858f909f4603b6c92999c2040ea29841a120b916d5a678c11c6d83468a357d5fe3ce15f60b9b9cdc5f3118f5732
6
+ metadata.gz: 908de44e4d49035037a83f508074c273af88c8ff465147e569ecb062e6a19c818bdd0e8812830f5ce23b582fec0010e04dd9191e24095b024e04bcb07ed9ef69
7
+ data.tar.gz: 8a77c89234429113ac224c877a02a0fefa81fc4cc066e1c2a3b0e1b7b94129372396523e260e5280a6487f7cc41b8de2cc0efb1af63214108b664407657fa97b
@@ -207,7 +207,11 @@ module T::Private::Methods
207
207
  new_method = nil
208
208
  T::Private::ClassUtils.replace_method(mod, method_name) do |*args, &blk|
209
209
  method_sig = T::Private::Methods.maybe_run_sig_block_for_method(new_method)
210
- method_sig ||= T::Private::Methods._handle_missing_method_signature(mod, original_method, __callee__)
210
+ method_sig ||= T::Private::Methods._handle_missing_method_signature(
211
+ is_singleton_method ? self.singleton_class : self.class,
212
+ original_method,
213
+ __callee__,
214
+ )
211
215
 
212
216
  # Should be the same logic as CallValidation.wrap_method_if_needed but we
213
217
  # don't want that extra layer of indirection in the callstack
@@ -238,9 +242,11 @@ module T::Private::Methods
238
242
  end
239
243
  end
240
244
 
241
- def self._handle_missing_method_signature(mod, original_method, callee)
245
+ def self._handle_missing_method_signature(klass, original_method, callee)
242
246
  method_sig = T::Private::Methods.signature_for_method(original_method)
243
- aliasing_method = mod.instance_method(callee)
247
+
248
+ aliasing_method = klass.instance_method(callee)
249
+ aliasing_mod = aliasing_method.owner
244
250
 
245
251
  if method_sig && aliasing_method != original_method && aliasing_method.original_name == original_method.name
246
252
  # We're handling a case where `alias` or `alias_method` was called for a
@@ -249,10 +255,10 @@ module T::Private::Methods
249
255
  # Note, this logic is duplicated above, make sure to keep changes in sync.
250
256
  if method_sig.check_level == :always || (method_sig.check_level == :tests && T::Private::RuntimeLevels.check_tests?)
251
257
  # Checked, so copy the original signature to the aliased copy.
252
- T::Private::Methods.unwrap_method(mod, method_sig, aliasing_method)
258
+ T::Private::Methods.unwrap_method(aliasing_mod, method_sig, aliasing_method)
253
259
  else
254
260
  # Unchecked, so just make `alias_method` behave as if it had been called pre-sig.
255
- mod.send(:alias_method, callee, original_method.name)
261
+ aliasing_mod.send(:alias_method, callee, original_method.name)
256
262
  end
257
263
  else
258
264
  raise "`sig` not present for method `#{aliasing_method.name}` but you're trying to run it anyways. " \
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5851
4
+ version: 0.5.5855
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-29 00:00:00.000000000 Z
11
+ date: 2020-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest