sorbet-runtime 0.6.12651 → 0.6.12656

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: bf242cd98e0bd1c942ee3802a6991874024c3994eb7197ed0769fb10018fd0e2
4
- data.tar.gz: c19814441baba8dd7a2144c926c7da09e21ba4bc8666620b4d20dbe4794e59a5
3
+ metadata.gz: bcb098ff5d7ac2ec5cd93b00ff1c3c6e086a35c9c918612448c003a3a53bda12
4
+ data.tar.gz: d97199f3dd5f857ac208deb3e7a9d1c375c56bb8fa75b12df9ae1e3358b6c086
5
5
  SHA512:
6
- metadata.gz: a55afa777e396c4ac4552f9119ee4fdcbd8a2451f54354f4ec00fe558b4b1771cebc89b2ae6a0fed4ec269a9d01bea4329b4204b068464cf0311c5da2d46e35a
7
- data.tar.gz: 27d933e4e01d1cea4151ac6b2635ffcab567cd2a5bb050da104bf0f9bcc8f4c17f061aaed0b053168c242802e0a2a20ca8d4d66258b97c6380054e9f179c8d2d
6
+ metadata.gz: 47a1299e2d505bca7377fae7640983fa52afae0af6ff645cb79462c0768c6d2a61380901f2f8324da2f00a7fdd14e1cdcc0c28177ce0548cad4f74b43f4e43e1
7
+ data.tar.gz: 6996c15c5904b3e98eddf382d009da6a86d8b622043f38ab54b893279056a9e83fd6b2f98db34bf9a68fc13d0f6bbc5f72fa2225b92ad02c9c43fa489a0b5e2b
@@ -2,9 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module T::Configuration
5
- # Cache this comparisonn to avoid two allocations all over the place.
6
- AT_LEAST_RUBY_2_7 = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7')
7
-
8
5
  # Announces to Sorbet that we are currently in a test environment, so it
9
6
  # should treat any sigs which are marked `.checked(:tests)` as if they were
10
7
  # just a normal sig.
@@ -448,11 +445,7 @@ module T::Configuration
448
445
  MODULE_NAME = Module.instance_method(:name)
449
446
  private_constant :MODULE_NAME
450
447
 
451
- @default_module_name_mangler = if T::Configuration::AT_LEAST_RUBY_2_7
452
- ->(type) { MODULE_NAME.bind_call(type) }
453
- else
454
- ->(type) { MODULE_NAME.bind(type).call } # rubocop:disable Performance/BindCall
455
- end
448
+ @default_module_name_mangler = ->(type) { MODULE_NAME.bind_call(type) }
456
449
 
457
450
  @module_name_mangler = nil
458
451
 
@@ -257,10 +257,8 @@ module T::Private::Methods
257
257
  # make sure to keep changes in sync.
258
258
  elsif method_sig.check_level == :always || (method_sig.check_level == :tests && T::Private::RuntimeLevels.check_tests?)
259
259
  CallValidation.validate_call(self, original_method, method_sig, args, blk)
260
- elsif T::Configuration::AT_LEAST_RUBY_2_7
261
- original_method.bind_call(self, *args, &blk)
262
260
  else
263
- original_method.bind(self).call(*args, &blk) # rubocop:disable Performance/BindCall
261
+ original_method.bind_call(self, *args, &blk)
264
262
  end
265
263
  end
266
264
  end
@@ -530,27 +528,15 @@ module T::Private::Methods
530
528
  @old_hooks = nil
531
529
  else
532
530
  old_included = T::Private::ClassUtils.replace_method(Module, :included, true) do |arg|
533
- if T::Configuration::AT_LEAST_RUBY_2_7
534
- old_included.bind_call(self, arg)
535
- else
536
- old_included.bind(self).call(arg) # rubocop:disable Performance/BindCall
537
- end
531
+ old_included.bind_call(self, arg)
538
532
  ::T::Private::Methods._hook_impl(arg, false, self)
539
533
  end
540
534
  old_extended = T::Private::ClassUtils.replace_method(Module, :extended, true) do |arg|
541
- if T::Configuration::AT_LEAST_RUBY_2_7
542
- old_extended.bind_call(self, arg)
543
- else
544
- old_extended.bind(self).call(arg) # rubocop:disable Performance/BindCall
545
- end
535
+ old_extended.bind_call(self, arg)
546
536
  ::T::Private::Methods._hook_impl(arg, true, self)
547
537
  end
548
538
  old_inherited = T::Private::ClassUtils.replace_method(Class, :inherited, true) do |arg|
549
- if T::Configuration::AT_LEAST_RUBY_2_7
550
- old_inherited.bind_call(self, arg)
551
- else
552
- old_inherited.bind(self).call(arg) # rubocop:disable Performance/BindCall
553
- end
539
+ old_inherited.bind_call(self, arg)
554
540
  ::T::Private::Methods._hook_impl(arg, false, self)
555
541
  end
556
542
  @old_hooks = [old_included, old_extended, old_inherited]
@@ -176,7 +176,7 @@ module T::Private::Methods::CallValidation
176
176
  # this code is sig validation code.
177
177
  # Please issue `finish` to step out of it
178
178
 
179
- return_value = T::Configuration::AT_LEAST_RUBY_2_7 ? original_method.bind_call(instance, *args, &blk) : original_method.bind(instance).call(*args, &blk)
179
+ return_value = original_method.bind_call(instance, *args, &blk)
180
180
 
181
181
  # The only type that is allowed to change the return value is `.void`.
182
182
  # It ignores what you returned and changes it to be a private singleton.
@@ -279,7 +279,7 @@ module T::Private::Methods::CallValidation
279
279
  # this code is sig validation code.
280
280
  # Please issue `finish` to step out of it
281
281
 
282
- return_value = T::Configuration::AT_LEAST_RUBY_2_7 ? original_method.bind_call(instance, *args, &blk) : original_method.bind(instance).call(*args, &blk)
282
+ return_value = original_method.bind_call(instance, *args, &blk)
283
283
 
284
284
  # The only type that is allowed to change the return value is `.void`.
285
285
  # It ignores what you returned and changes it to be a private singleton.
@@ -332,8 +332,4 @@ module T::Private::Methods::CallValidation
332
332
  end
333
333
  end
334
334
 
335
- if T::Configuration::AT_LEAST_RUBY_2_7
336
- require_relative './call_validation_2_7'
337
- else
338
- require_relative './call_validation_2_6'
339
- end
335
+ require_relative './call_validation_2_7'
@@ -168,11 +168,7 @@ module T::Types
168
168
  obj.class
169
169
  else
170
170
  # This is a specialized enumerable type, just return the class.
171
- if T::Configuration::AT_LEAST_RUBY_2_7
172
- Object.instance_method(:class).bind_call(obj)
173
- else
174
- Object.instance_method(:class).bind(obj).call # rubocop:disable Performance/BindCall
175
- end
171
+ Object.instance_method(:class).bind_call(obj)
176
172
  end
177
173
  end
178
174
 
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.6.12651
4
+ version: 0.6.12656
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-21 00:00:00.000000000 Z
11
+ date: 2025-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -177,7 +177,6 @@ files:
177
177
  - lib/types/private/final.rb
178
178
  - lib/types/private/methods/_methods.rb
179
179
  - lib/types/private/methods/call_validation.rb
180
- - lib/types/private/methods/call_validation_2_6.rb
181
180
  - lib/types/private/methods/call_validation_2_7.rb
182
181
  - lib/types/private/methods/decl_builder.rb
183
182
  - lib/types/private/methods/modes.rb