sorbet-runtime 0.6.13593 → 0.6.13612

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: af42d96b42e49a77b9b8e3dbe6ba977ec6bc2573fd21366f9afef4cb8dc0b058
4
- data.tar.gz: 876ea455a84ac9fd409beba3aea9a9af013eac91184b1465efe6c86e42b08040
3
+ metadata.gz: 2a55754bbdc43cfcf4bf7fee9c48115331cc0f1382cdb8419b7892751d2ca1b6
4
+ data.tar.gz: 7be4e804bb6055583e367662baacff6217a5f0806b0d069e4dfef05d0837431f
5
5
  SHA512:
6
- metadata.gz: 1e02523341a0fd48d2df724656a9858f33036c752cbf36a2baec25622801f8db6da1b1ad0565f0a96f2dc2be6c1463962c9f20c5f4256d1ceaed8c5e5a9f71f1
7
- data.tar.gz: 22c6a294c524b07d92181fa80c6250b77ff0d638f22472cd9993755887a6160b8e2632aa140d3602e5110d7cb1e4b831bc9755c3537dee2bfa664a003b7286bd
6
+ metadata.gz: 559bedbd9597db5b2502796002d6911ee4fc2dba33d8a2f0d4c890bf2156db1079f191e7b6768dd4963fb378691d69a0b1c2200f6eb9ca3a3c97cfc473fcc471
7
+ data.tar.gz: e30c5fc33877556d12997f7b2484a4abdeb4fcb4224792c6ba8e3c8310850a41e913c6f761cbc538ad568a792f8c51eae28a4e50f7457ce6464487ba7d23b140
@@ -508,7 +508,7 @@ module T::Private::Methods
508
508
  # Executes the `sig` block, and converts the resulting Declaration
509
509
  # to a Signature.
510
510
  def self.run_sig(method_name, original_method, declaration_block, unwrap:)
511
- current_declaration =
511
+ current_decl_or_sig =
512
512
  begin
513
513
  run_builder(declaration_block)
514
514
  rescue DeclBuilder::BuilderError => e
@@ -516,12 +516,16 @@ module T::Private::Methods
516
516
  nil
517
517
  end
518
518
 
519
+ # Another thread can finish initialization after this call enters the
520
+ # first-call wrapper but before run_builder reads sig_state.
521
+ return current_decl_or_sig if current_decl_or_sig.is_a?(Signature)
522
+
519
523
  # Release location information sooner
520
524
  declaration_block.loc = nil
521
525
 
522
526
  signature =
523
- if current_declaration
524
- build_sig(method_name, original_method, current_declaration)
527
+ if current_decl_or_sig
528
+ build_sig(method_name, original_method, current_decl_or_sig)
525
529
  else
526
530
  Signature.new_untyped(method: original_method)
527
531
  end
@@ -547,10 +551,7 @@ module T::Private::Methods
547
551
 
548
552
  def self.run_builder(declaration_block)
549
553
  sig_state = declaration_block.sig_state
550
- return sig_state if sig_state.is_a?(Declaration)
551
- if !sig_state.is_a?(Proc)
552
- raise "DeclarationBlock for #{declaration_block.mod} at #{declaration_block.loc} should have already been unwrapped"
553
- end
554
+ return sig_state unless sig_state.is_a?(Proc)
554
555
 
555
556
  builder = DeclBuilder.new(
556
557
  declaration_block.mod,
@@ -615,10 +616,6 @@ module T::Private::Methods
615
616
  @signatures_by_method[method_to_key(maybe_wrapped_method)] = signature
616
617
  end
617
618
 
618
- def self.has_sig_block_for_method(method)
619
- has_sig_block_for_key(method_to_key(method))
620
- end
621
-
622
619
  # Only public because it needs to get called inside the first-call wrapper closure.
623
620
  def self._sig_block_is_current?(key, sig_block)
624
621
  @sig_wrappers[key].equal?(sig_block)
@@ -637,10 +634,6 @@ module T::Private::Methods
637
634
  run_sig_block_for_key(key) if has_sig_block_for_key(key)
638
635
  end
639
636
 
640
- def self.run_sig_block_for_method(method)
641
- run_sig_block_for_key(method_to_key(method))
642
- end
643
-
644
637
  # use this directly if you don't want/need to box up the method into an object to pass to method_to_key.
645
638
  private_class_method def self.method_owner_and_name_to_key(owner, name)
646
639
  "#{owner.object_id}##{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.13593
4
+ version: 0.6.13612
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe