sorbet-runtime 0.6.13281 → 0.6.13282

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: aaa4eaf7440ab0887a2d95dec4d0be0d149410e22cae9f348b5a8270bb19796a
4
- data.tar.gz: 8258b1befb96c28b5df177d984b51a75bbc97f005acf81f86b79add2938ad273
3
+ metadata.gz: 3a0290df342cc018e940ad2e2a6d0c2cb818f51efecd8a75a52a51f8c0d2e529
4
+ data.tar.gz: 717521fe6f84077e8af3aa2ae9da890b8062dd4c9f2ec926116f39c56d3c8e40
5
5
  SHA512:
6
- metadata.gz: 5bfa0d8826de0338cc2bffc9b11f813fabbb90bde6d1da666b8b870b58ddbc113e3c6ff8e0086ea2f0f91fbacbf2f739edadd0ad1e36bc01418d5161403f68be
7
- data.tar.gz: 06cf53f3de854380be2cd661cc9503e73365918f959af3d85827443d5d7594981a27c65acbea58ee518f59f480aa60e9e2acd8dda8ee53e5e327e594b3425a84
6
+ metadata.gz: bc57cc0880f55d9d041c2f6890a28ccb391f03bfea556ef9af842ece6ca21ce7e51df88763895c26bd1e1618fd5ae4b31be1d249a62df4c8b3427bfa6cd5f1d7
7
+ data.tar.gz: 7e059978f282db576c909dd1c2a3497f9a1a2fe6618a8d4c9455bf097b8d9d77572fa7a3829e854d9b446658476f7475bcac9048fc1808c82895c02bbbe852b5
@@ -217,9 +217,21 @@ module T::Private::Methods
217
217
  )
218
218
  end
219
219
 
220
+ # We allow `sig` in the current module's context (normal case) and
221
+ if hook_mod != current_declaration.mod &&
222
+ # inside `class << self`, and
223
+ hook_mod.singleton_class != current_declaration.mod &&
224
+ # on `self` at the top level of a file
225
+ current_declaration.mod != TOP_SELF
226
+ raise "A method (#{method_name}) is being added on a different class/module (#{hook_mod}) than the " \
227
+ "last call to `sig` (#{current_declaration.mod}). Make sure each call " \
228
+ "to `sig` is immediately followed by a method definition on the same " \
229
+ "class/module."
230
+ end
231
+
220
232
  original_method = mod.instance_method(method_name)
221
233
  sig_block = lambda do
222
- T::Private::Methods.run_sig(hook_mod, method_name, original_method, current_declaration)
234
+ T::Private::Methods.run_sig(method_name, original_method, current_declaration)
223
235
  end
224
236
 
225
237
  # Always replace the original method with this wrapper,
@@ -298,7 +310,7 @@ module T::Private::Methods
298
310
 
299
311
  # Executes the `sig` block, and converts the resulting Declaration
300
312
  # to a Signature.
301
- def self.run_sig(hook_mod, method_name, original_method, declaration_block)
313
+ def self.run_sig(method_name, original_method, declaration_block)
302
314
  current_declaration =
303
315
  begin
304
316
  run_builder(declaration_block)
@@ -312,7 +324,7 @@ module T::Private::Methods
312
324
 
313
325
  signature =
314
326
  if current_declaration
315
- build_sig(hook_mod, method_name, original_method, current_declaration)
327
+ build_sig(method_name, original_method, current_declaration)
316
328
  else
317
329
  Signature.new_untyped(method: original_method)
318
330
  end
@@ -342,20 +354,8 @@ module T::Private::Methods
342
354
  decl
343
355
  end
344
356
 
345
- def self.build_sig(hook_mod, method_name, original_method, current_declaration)
357
+ def self.build_sig(method_name, original_method, current_declaration)
346
358
  begin
347
- # We allow `sig` in the current module's context (normal case) and
348
- if hook_mod != current_declaration.mod &&
349
- # inside `class << self`, and
350
- hook_mod.singleton_class != current_declaration.mod &&
351
- # on `self` at the top level of a file
352
- current_declaration.mod != TOP_SELF
353
- raise "A method (#{method_name}) is being added on a different class/module (#{hook_mod}) than the " \
354
- "last call to `sig` (#{current_declaration.mod}). Make sure each call " \
355
- "to `sig` is immediately followed by a method definition on the same " \
356
- "class/module."
357
- end
358
-
359
359
  signature = Signature.new(
360
360
  method: original_method,
361
361
  method_name: method_name,
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.13281
4
+ version: 0.6.13282
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe