sorbet-runtime 0.5.11495 → 0.5.11501
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/base.rb +3 -3
- data/lib/types/types/class_of.rb +1 -1
- data/lib/types/types/proc.rb +1 -1
- data/lib/types/types/typed_array.rb +1 -1
- data/lib/types/types/typed_class.rb +1 -1
- data/lib/types/types/typed_enumerable.rb +5 -6
- data/lib/types/types/typed_enumerator.rb +1 -1
- data/lib/types/types/typed_enumerator_chain.rb +1 -1
- data/lib/types/types/typed_enumerator_lazy.rb +1 -1
- data/lib/types/types/typed_range.rb +1 -1
- data/lib/types/types/typed_set.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: 90895a6ea313ec4dd6dbfe7d4f0708c27949e1e2852f34762a21c684030ee4cf
|
4
|
+
data.tar.gz: 4fb72a9cbf44eb46354a323a7e7a898f3ef17f0a68b9bff3219def6406796129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e700714ba7efa118c7a72cf796e9f8ea317f29cd22ca85e9813bbcdcd1f9ff080d4520b863f7b249bf362dae72f09027fb5f1e22f0630255e8b4754b8b5e336
|
7
|
+
data.tar.gz: 5d8ebc9ed5af1304be18d35ff38485da2ef7390ff5f27ca8a83dd598c642eeab6c0264ba420ec8930207fedb1663da165735e34d0d1145944e792de32764430d
|
data/lib/types/types/base.rb
CHANGED
@@ -21,7 +21,7 @@ module T::Types
|
|
21
21
|
valid?(obj)
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
define_method(:valid?) do |_obj|
|
25
25
|
raise NotImplementedError
|
26
26
|
end
|
27
27
|
|
@@ -35,12 +35,12 @@ module T::Types
|
|
35
35
|
|
36
36
|
# Force any lazy initialization that this type might need to do
|
37
37
|
# It's unusual to call this directly; you probably want to call it indirectly via `T::Utils.run_all_sig_blocks`.
|
38
|
-
|
38
|
+
define_method(:build_type) do
|
39
39
|
raise NotImplementedError
|
40
40
|
end
|
41
41
|
|
42
42
|
# Equality is based on name, so be sure the name reflects all relevant state when implementing.
|
43
|
-
|
43
|
+
define_method(:name) do
|
44
44
|
raise NotImplementedError
|
45
45
|
end
|
46
46
|
|
data/lib/types/types/class_of.rb
CHANGED
data/lib/types/types/proc.rb
CHANGED
@@ -47,11 +47,10 @@ module T::Types
|
|
47
47
|
true
|
48
48
|
end
|
49
49
|
when Hash
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
key_type
|
54
|
-
value_type = types[1]
|
50
|
+
type_ = self.type
|
51
|
+
return false unless type_.is_a?(FixedArray)
|
52
|
+
key_type, value_type = type_.types
|
53
|
+
return false if key_type.nil? || value_type.nil? || type_.types.size > 2
|
55
54
|
obj.each_pair do |key, val|
|
56
55
|
# Some objects (I'm looking at you Rack::Utils::HeaderHash) don't
|
57
56
|
# iterate over a [key, value] array, so we can't just use the type.recursively_valid?(v)
|
@@ -179,7 +178,7 @@ module T::Types
|
|
179
178
|
|
180
179
|
class Untyped < TypedEnumerable
|
181
180
|
def initialize
|
182
|
-
super(T
|
181
|
+
super(T::Types::Untyped::Private::INSTANCE)
|
183
182
|
end
|
184
183
|
|
185
184
|
def valid?(obj)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
module T::Types
|
5
5
|
class TypedSet < TypedEnumerable
|
6
6
|
def underlying_class
|
7
|
-
|
7
|
+
Set
|
8
8
|
end
|
9
9
|
|
10
10
|
# overrides Base
|
@@ -37,7 +37,7 @@ module T::Types
|
|
37
37
|
|
38
38
|
class Untyped < TypedSet
|
39
39
|
def initialize
|
40
|
-
super(T
|
40
|
+
super(T::Types::Untyped::Private::INSTANCE)
|
41
41
|
end
|
42
42
|
|
43
43
|
def valid?(obj)
|
data/lib/types/utils.rb
CHANGED
@@ -155,7 +155,7 @@ module T::Utils
|
|
155
155
|
raise ArgumentError.new("#{enum.inspect} is not a T.deprecated_enum")
|
156
156
|
end
|
157
157
|
|
158
|
-
classes = enum.values.map(&:class).uniq
|
158
|
+
classes = T.unsafe(enum.values).map(&:class).uniq
|
159
159
|
if classes.empty?
|
160
160
|
T.untyped
|
161
161
|
elsif classes.length > 1
|
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.11501
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|