sorbet-runtime 0.5.5859 → 0.5.5862

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b26613ee717e93406be9863f6de88ba9ed7d56be71c14e5b9a0f6dea865f6bbd
4
- data.tar.gz: 7c52bb7c5ea5624c002a69e6f38c02f64cdf4f1f1b7b0b03a90093511cac169c
3
+ metadata.gz: 0e4f3bc5286319a6e352ee08fc7316790786e2f851d0854d1a265edeb423e913
4
+ data.tar.gz: 372eb903da66e3755c01f6ec548cf0cb90b4e94e5e4792a67a4ad410bae1c36c
5
5
  SHA512:
6
- metadata.gz: ce4dcea125090bb935cfe36e7d2c4c6421a4011b135a4c6f2eed4526c814b385d491f2e846629335181af9ec6f39fe7a2046d8333b971698e4a83f14397a3340
7
- data.tar.gz: 3b3d85510672d63af66e8603e848e98e4d8c1305e8946acc4a58b21079cbab63a510884e521cc744ba72d1136e7de10bb6d685eaade360af9f03e8fb50579a77
6
+ metadata.gz: 5d64a67fcc199c3f9d6c6ad7333be494c2ad0572d80ad0fbe080501183544fb844e8defbc2a8ba29ce4f525fe9dfef5ee2bf60a867a5c20cd00d96f81c4d6aac
7
+ data.tar.gz: de6518e01af0b32d22bd60372b8e49c0e01ae0369fc2939c4fd9c96916d99e7af2d8e3207ec4d07d0e2de2bca9aa06d40bbb396a3ecc66ea9faa88e41fc8de17
@@ -272,15 +272,8 @@ module T::Private::Methods
272
272
  receiving_method = receiving_class.instance_method(callee)
273
273
  if receiving_method != original_method && receiving_method.original_name == original_method.name
274
274
  aliasing_mod = receiving_method.owner
275
-
276
- # Note, this logic is duplicated above, make sure to keep changes in sync.
277
- if method_sig.check_level == :always || (method_sig.check_level == :tests && T::Private::RuntimeLevels.check_tests?)
278
- # Checked, so copy the original signature to the aliased copy.
279
- T::Private::Methods.unwrap_method(aliasing_mod, method_sig, original_method)
280
- else
281
- # Unchecked, so just make `alias_method` behave as if it had been called pre-sig.
282
- aliasing_mod.send(:alias_method, callee, original_method.name)
283
- end
275
+ method_sig = method_sig.as_alias(callee)
276
+ unwrap_method(aliasing_mod, method_sig, original_method)
284
277
  end
285
278
 
286
279
  method_sig
@@ -304,7 +297,7 @@ module T::Private::Methods
304
297
  Signature.new_untyped(method: original_method)
305
298
  end
306
299
 
307
- unwrap_method(hook_mod, signature, original_method)
300
+ unwrap_method(signature.method.owner, signature, original_method)
308
301
  signature
309
302
  end
310
303
 
@@ -356,8 +349,8 @@ module T::Private::Methods
356
349
  end
357
350
  end
358
351
 
359
- def self.unwrap_method(hook_mod, signature, original_method)
360
- maybe_wrapped_method = CallValidation.wrap_method_if_needed(signature.method.owner, signature, original_method)
352
+ def self.unwrap_method(mod, signature, original_method)
353
+ maybe_wrapped_method = CallValidation.wrap_method_if_needed(mod, signature, original_method)
361
354
  @signatures_by_method[method_to_key(maybe_wrapped_method)] = signature
362
355
  end
363
356
 
@@ -121,6 +121,15 @@ class T::Private::Methods::Signature
121
121
  end
122
122
  end
123
123
 
124
+ attr_writer :method_name
125
+ protected :method_name=
126
+
127
+ def as_alias(alias_name)
128
+ new_sig = clone
129
+ new_sig.method_name = alias_name
130
+ new_sig
131
+ end
132
+
124
133
  def arg_count
125
134
  @arg_types.length
126
135
  end
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.5859
4
+ version: 0.5.5862
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-01 00:00:00.000000000 Z
11
+ date: 2020-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest