sorbet-runtime 0.6.13596 → 0.6.13599
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 +4 -4
- data/lib/types/private/methods/_methods.rb +8 -15
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70d817dc6334af69fba349d600ccf280ee0b9a23f3b51f625733bb9d7c5d91f5
|
|
4
|
+
data.tar.gz: 7be4e804bb6055583e367662baacff6217a5f0806b0d069e4dfef05d0837431f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2924027714437955610958ea49168732fb4a7f8e9d92dccc4cd93b2244bbdf57fa6d7baaf92953d005af4aba116e2586de6d37f8b3449401aa06b6a8c12d4cb6
|
|
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
|
-
|
|
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
|
|
524
|
-
build_sig(method_name, original_method,
|
|
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
|
|
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}"
|