sorbet-runtime 0.5.5435 → 0.5.5439

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: '083f68bb85dcf7f8ca2605bc29505bab76eed135d83c68d0df7d2a5c12a7fb8c'
4
- data.tar.gz: ca313a1c68882d0658c175e43df6160541547c3c9468233759dc8b24afe2e8ab
3
+ metadata.gz: 15b884405afe5ef1a9261206433553142c10166302d6bcc80e9ffed82343ac4c
4
+ data.tar.gz: 2c5a550e1d9b9363cacefc36ce53fa86a3b36bde40f6f018e8bfad4632130a5b
5
5
  SHA512:
6
- metadata.gz: ce2828cd11dcc39936042dfe47e9affd41e0cc5097989d69fb350ab5dac9a7a1fe77f06f9cad23f49d1bce2cbf15b322b17d4016fbaff77ffb1ccdb3c6dd33d4
7
- data.tar.gz: c621baf36a52bdaefdb5131905bb96a4d850b2ad1d8207952e45558e04757ef587afeaffa3e9c461c00efec2c83b1ad4c01d762328c23d4876900fa3dc846d8f
6
+ metadata.gz: '0038a4dd9590fd6c8cdd30c41eea8767f2ad6c30e779979e8d4b880132c8d352343d0a46ef1ef1852edcadc157b28b09e498d356721d518734817e0759958aa1'
7
+ data.tar.gz: c6e0dad262a7105db18b126d8fc01168ec3a3a7c5f6982f1753368561d77540b40384f7cfaed50e38e94767ff136a306c22d377b0c6db6ee965cd3d44f14a793
@@ -36,3 +36,46 @@ if defined? ::RSpec::Mocks::AnyInstance
36
36
  end
37
37
  end
38
38
  end
39
+
40
+ # Work around for sorbet-runtime wrapped methods.
41
+ #
42
+ # When a sig is defined, sorbet-runtime will replace the sigged method
43
+ # with a wrapper. Those wrapper methods look like `foo(*args, &blk)`
44
+ # so that wrappers can handle and pass on all the arguments supplied.
45
+ #
46
+ # However, that creates a problem with runtime reflection on the methods,
47
+ # since when a sigged method is introspected, it will always return its
48
+ # `arity` as `-1`, its `parameters` as `[[:rest, :args], [:block, :blk]]`,
49
+ # and its `source_location` as `[<some_file_in_sorbet>, <some_line_number>]`.
50
+ #
51
+ # This might be a problem for some applications that rely on getting the
52
+ # correct information from these methods.
53
+ #
54
+ # This compatibility module, when prepended to the `Method` class, would fix
55
+ # the return values of `arity`, `parameters` and `source_location`.
56
+ #
57
+ # @example
58
+ # require 'sorbet-runtime'
59
+ # ::Method.prepend(T::CompatibilityPatches::MethodExtensions)
60
+ module T
61
+ module CompatibilityPatches
62
+ module MethodExtensions
63
+ def arity
64
+ arity = super
65
+ return arity if arity != -1 || self.is_a?(Proc)
66
+ sig = T::Private::Methods.signature_for_method(self)
67
+ sig ? sig.method.arity : arity
68
+ end
69
+
70
+ def source_location
71
+ sig = T::Private::Methods.signature_for_method(self)
72
+ sig ? sig.method.source_location : super
73
+ end
74
+
75
+ def parameters
76
+ sig = T::Private::Methods.signature_for_method(self)
77
+ sig ? sig.method.parameters : super
78
+ end
79
+ end
80
+ end
81
+ end
@@ -602,7 +602,7 @@ class T::Props::Decorator
602
602
  sig do
603
603
  params(
604
604
  prop_name: Symbol,
605
- redaction: Chalk::Tools::RedactionUtils::RedactionDirectiveSpec,
605
+ redaction: T.untyped,
606
606
  )
607
607
  .void
608
608
  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.5435
4
+ version: 0.5.5439
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-13 00:00:00.000000000 Z
11
+ date: 2020-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest