sorbet-runtime 0.5.11493 → 0.5.11500
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: 327eda423e826a22d08cc5812904a09e4b6d994dc67da73565f1799e22083471
|
4
|
+
data.tar.gz: f20584ed98f8b5ee8bc663d4c9502fba11fea615e29558549ca150b8a89c8b26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc21d64a989ab90783d9f40bd2875ff307507ef814d06a752729396e75ac2441e81544ab1a4dfe8780e0714a520310e56b1c5d964514941a223edbddfa99118
|
7
|
+
data.tar.gz: 04d56e7d0ce14f9226d71400611fa03dff780b33a114f4a0b1581bcbfa82b0b34896175679797c287d8aa3f39e47891dd583e5082badf1402abb1dab56424944
|
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.11500
|
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-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|