sorbet-runtime 0.5.10417 → 0.5.10426
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/types/_types.rb +4 -4
- data/lib/types/private/casts.rb +2 -2
- data/lib/types/utils.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f540eaa803e12258505f424a6f1d9e1f6bdf9ce7ef7298c2e41ba67666b1d037
|
4
|
+
data.tar.gz: 00ed4c42c3fa70b2a044924310d8d320eac535c13b5a4100bebfa1220ae14297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79f0dd8f905a74f2c6a9bf71a11fe9fb6256b0640e13d3aeafafe830b99b26e27dcf20e65e26a352471b669f153ee8ac506f8df5cf4ff66094d6cc9ae4bfe74d
|
7
|
+
data.tar.gz: de676133af3aebc9f5d5cd02d897bdc241265b038df7f19812f0b4b378a394082a1bf077f567d63abd54e13837feb29edf1864ce91d2dc21e22564992d7caf72
|
data/lib/types/_types.rb
CHANGED
@@ -130,7 +130,7 @@ module T
|
|
130
130
|
def self.cast(value, type, checked: true)
|
131
131
|
return value unless checked
|
132
132
|
|
133
|
-
Private::Casts.cast(value, type,
|
133
|
+
Private::Casts.cast(value, type, "T.cast")
|
134
134
|
end
|
135
135
|
|
136
136
|
# Tells the typechecker to declare a variable of type `type`. Use
|
@@ -145,7 +145,7 @@ module T
|
|
145
145
|
def self.let(value, type, checked: true)
|
146
146
|
return value unless checked
|
147
147
|
|
148
|
-
Private::Casts.cast(value, type,
|
148
|
+
Private::Casts.cast(value, type, "T.let")
|
149
149
|
end
|
150
150
|
|
151
151
|
# Tells the type checker to treat `self` in the current block as `type`.
|
@@ -164,7 +164,7 @@ module T
|
|
164
164
|
def self.bind(value, type, checked: true)
|
165
165
|
return value unless checked
|
166
166
|
|
167
|
-
Private::Casts.cast(value, type,
|
167
|
+
Private::Casts.cast(value, type, "T.bind")
|
168
168
|
end
|
169
169
|
|
170
170
|
# Tells the typechecker to ensure that `value` is of type `type` (if not, the typechecker will
|
@@ -174,7 +174,7 @@ module T
|
|
174
174
|
def self.assert_type!(value, type, checked: true)
|
175
175
|
return value unless checked
|
176
176
|
|
177
|
-
Private::Casts.cast(value, type,
|
177
|
+
Private::Casts.cast(value, type, "T.assert_type!")
|
178
178
|
end
|
179
179
|
|
180
180
|
# For the static type checker, strips all type information from a value
|
data/lib/types/private/casts.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
module T::Private
|
5
5
|
module Casts
|
6
|
-
def self.cast(value, type, cast_method
|
6
|
+
def self.cast(value, type, cast_method)
|
7
7
|
begin
|
8
8
|
error = T::Utils.coerce(type).error_message_for_obj(value)
|
9
9
|
return value unless error
|
@@ -22,7 +22,7 @@ module T::Private
|
|
22
22
|
# there's a lot of shared logic with the above one, but factoring
|
23
23
|
# it out like this makes it easier to hopefully one day delete
|
24
24
|
# this one
|
25
|
-
def self.cast_recursive(value, type, cast_method
|
25
|
+
def self.cast_recursive(value, type, cast_method)
|
26
26
|
begin
|
27
27
|
error = T::Utils.coerce(type).error_message_for_obj_recursive(value)
|
28
28
|
return value unless error
|
data/lib/types/utils.rb
CHANGED
@@ -32,7 +32,7 @@ module T::Utils
|
|
32
32
|
# in some cases this runtime check can be very expensive, especially
|
33
33
|
# with large collections of objects.
|
34
34
|
def self.check_type_recursive!(value, type)
|
35
|
-
T::Private::Casts.cast_recursive(value, type,
|
35
|
+
T::Private::Casts.cast_recursive(value, type, "T.check_type_recursive!")
|
36
36
|
end
|
37
37
|
|
38
38
|
# Returns the set of all methods (public, protected, private) defined on a module or its
|
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.
|
4
|
+
version: 0.5.10426
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|