sorbet-runtime 0.5.10417 → 0.5.10422
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: a327f13e4d476cdfa6c447310e7fcbe687f565eb3d5e2269868585440bbb36c0
|
4
|
+
data.tar.gz: ace0bd45b9d8d4630103836e7366bdc6f88c4d3dd009509363bc1b83bfa08942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0575bde5436bdde9b959f15ccc5bb66690b569861950f7efe5cb7126d420d34c6bb49c8dd8f0d2ac317a925526c73eafc1d3a16777efc7b34a5dc4487947d98a
|
7
|
+
data.tar.gz: 8a9286a6c2983a358d7cae340bfc84b550d02885bbaaad19760a183fac0b4bedac99bc06015d2d1b203eb71ec54cb6a10cef504ff2c631608119d72a5d6ec837
|
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.10422
|
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-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|