sorbet-runtime 0.6.12751 → 0.6.12763

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 841c6873c183344c343b0c6ab33c4a11229555492fcb1201d68d7fb9ce6d3e07
4
- data.tar.gz: 713c973f80cdd85a78a3d4b5fea2e443048033c022406576f92382a8cb0ede6b
3
+ metadata.gz: 2d5e5b3b08f312cfa3d5dd5c0ca7682f5acdd9c39a55ae05fe11516b01351bc0
4
+ data.tar.gz: 3bf1d92535f85d606002f3cf09c17b098d83c871b574d05563b7f172e9693fe2
5
5
  SHA512:
6
- metadata.gz: 4391550541350d813ad3c54255f0d9c4049d7ed4288ea858d677384c3a03baeaad527fd4fe447a3698535e4174eeeb6f1cf6a6ad06e402ebdc9d2b4b12662d42
7
- data.tar.gz: c8c77644763380728372a302cae378631f8f86d98676ac4bdbd7ef558678f86c78434be985b4171631d2de3a1e1c28ca12f15c939b888248c78f9edfb09ea2ea
6
+ metadata.gz: 7751e6cc515df065dc3cfcae2df8523fe813b3f8282809de0d432494df5b7a088d2499341a349898a5f6c3c99825edf8eb080c8ffdbb74977e318a728a186f01
7
+ data.tar.gz: 8e1cd9759daeebb08a24a4c90f104d5e47fbaa1e0016523b9e5c93028016eb9bbcc074a7108891220d877be1f13229331c4e96347240bf6cd405e07ff3468ef6
data/lib/types/enum.rb CHANGED
@@ -273,7 +273,7 @@ class T::Enum
273
273
 
274
274
  ### Private implementation ###
275
275
 
276
- UNSET = T.let(Module.new.freeze, Module)
276
+ UNSET = T.let(Module.new.freeze, T::Module[T.anything])
277
277
  private_constant :UNSET
278
278
 
279
279
  sig { params(serialized_val: SerializedVal).void }
@@ -50,7 +50,7 @@ module T::Props
50
50
  sig { abstract.params(scalar: T.untyped).returns(T.untyped).checked(:never) }
51
51
  def deserialize(scalar); end
52
52
 
53
- sig { override.params(_base: Module).void }
53
+ sig { override.params(_base: T::Module[T.anything]).void }
54
54
  def self.included(_base)
55
55
  super
56
56
 
@@ -13,8 +13,10 @@ class T::Props::Decorator
13
13
  Rules = T.type_alias { T::Hash[Symbol, T.untyped] }
14
14
  DecoratedInstance = T.type_alias { Object } # Would be T::Props, but that produces circular reference errors in some circumstances
15
15
  PropType = T.type_alias { T::Types::Base }
16
- PropTypeOrClass = T.type_alias { T.any(PropType, Module) }
16
+ PropTypeOrClass = T.type_alias { T.any(PropType, T::Module[T.anything]) }
17
17
  OverrideRules = T.type_alias { T::Hash[Symbol, {allow_incompatible: T::Boolean}] }
18
+ DecoratedClassType = T.type_alias { T.all(T::Module[T.anything], T::Props::ClassMethods) }
19
+ private_constant :DecoratedClassType
18
20
 
19
21
  class NoRulesError < StandardError; end
20
22
 
@@ -38,7 +40,7 @@ class T::Props::Decorator
38
40
 
39
41
  sig { params(klass: T.untyped).void.checked(:never) }
40
42
  def initialize(klass)
41
- @class = T.let(klass, T.all(Module, T::Props::ClassMethods))
43
+ @class = T.let(klass, DecoratedClassType)
42
44
  @class.plugins.each do |mod|
43
45
  T::Props::Plugin::Private.apply_decorator_methods(mod, self)
44
46
  end
@@ -102,7 +104,7 @@ class T::Props::Decorator
102
104
  end
103
105
 
104
106
  # checked(:never) - O(prop accesses)
105
- sig { returns(T.all(Module, T::Props::ClassMethods)).checked(:never) }
107
+ sig { returns(DecoratedClassType).checked(:never) }
106
108
  def decorated_class
107
109
  @class
108
110
  end
@@ -207,7 +209,7 @@ class T::Props::Decorator
207
209
  params(
208
210
  instance: DecoratedInstance,
209
211
  prop: Symbol,
210
- foreign_class: Module,
212
+ foreign_class: T::Module[T.anything],
211
213
  rules: Rules,
212
214
  opts: T::Hash[Symbol, T.untyped],
213
215
  )
@@ -226,7 +228,7 @@ class T::Props::Decorator
226
228
  sig do
227
229
  params(
228
230
  name: Symbol,
229
- cls: Module,
231
+ cls: T::Module[T.anything],
230
232
  rules: Rules,
231
233
  type: PropTypeOrClass
232
234
  )
@@ -277,7 +279,7 @@ class T::Props::Decorator
277
279
  end
278
280
 
279
281
  # This converts the type from a T::Type to a regular old ruby class.
280
- sig { params(type: T::Types::Base).returns(Module).checked(:never) }
282
+ sig { params(type: T::Types::Base).returns(T::Module[T.anything]).checked(:never) }
281
283
  private def convert_type_to_class(type)
282
284
  case type
283
285
  when T::Types::TypedArray, T::Types::FixedArray
@@ -586,7 +588,7 @@ class T::Props::Decorator
586
588
  sig do
587
589
  params(
588
590
  prop_name: Symbol,
589
- prop_cls: Module,
591
+ prop_cls: T::Module[T.anything],
590
592
  rules: Rules,
591
593
  foreign: T.untyped,
592
594
  )
@@ -629,10 +631,10 @@ class T::Props::Decorator
629
631
  #
630
632
  # This gets called when a module or class that extends T::Props gets included, extended,
631
633
  # prepended, or inherited.
632
- sig { params(child: Module).void.checked(:never) }
634
+ sig { params(child: T::Module[T.anything]).void.checked(:never) }
633
635
  def model_inherited(child)
634
636
  child.extend(T::Props::ClassMethods)
635
- child = T.cast(child, T.all(Module, T::Props::ClassMethods))
637
+ child = T.cast(child, DecoratedClassType)
636
638
 
637
639
  child.plugins.concat(decorated_class.plugins)
638
640
  decorated_class.plugins.each do |mod|
@@ -719,19 +721,19 @@ class T::Props::Decorator
719
721
  result
720
722
  end
721
723
 
722
- sig { params(child: T.all(Module, T::Props::ClassMethods), prop: Symbol).returns(T::Boolean).checked(:never) }
724
+ sig { params(child: DecoratedClassType, prop: Symbol).returns(T::Boolean).checked(:never) }
723
725
  private def clobber_getter?(child, prop)
724
726
  !!(child.decorator.method(:prop_get).owner != method(:prop_get).owner &&
725
727
  child.instance_method(prop).source_location&.first == __FILE__)
726
728
  end
727
729
 
728
- sig { params(child: T.all(Module, T::Props::ClassMethods), prop: Symbol).returns(T::Boolean).checked(:never) }
730
+ sig { params(child: DecoratedClassType, prop: Symbol).returns(T::Boolean).checked(:never) }
729
731
  private def clobber_setter?(child, prop)
730
732
  !!(child.decorator.method(:prop_set).owner != method(:prop_set).owner &&
731
733
  child.instance_method("#{prop}=").source_location&.first == __FILE__)
732
734
  end
733
735
 
734
- sig { params(mod: Module).void.checked(:never) }
736
+ sig { params(mod: T::Module[T.anything]).void.checked(:never) }
735
737
  def plugin(mod)
736
738
  decorated_class.plugins << mod
737
739
  T::Props::Plugin::Private.apply_class_methods(mod, decorated_class)
@@ -27,10 +27,10 @@ module T::Props
27
27
  sig { abstract.params(instance: T.all(T::Props::Optional, Object)).void.checked(:never) }
28
28
  def set_default(instance); end
29
29
 
30
- NO_CLONE_TYPES = T.let([TrueClass, FalseClass, NilClass, Symbol, Numeric, T::Enum].freeze, T::Array[Module])
30
+ NO_CLONE_TYPES = T.let([TrueClass, FalseClass, NilClass, Symbol, Numeric, T::Enum].freeze, T::Array[T::Module[T.anything]])
31
31
 
32
32
  # checked(:never) - Rules hash is expensive to check
33
- sig { params(cls: Module, rules: T::Hash[Symbol, T.untyped]).returns(T.nilable(ApplyDefault)).checked(:never) }
33
+ sig { params(cls: T::Module[T.anything], rules: T::Hash[Symbol, T.untyped]).returns(T.nilable(ApplyDefault)).checked(:never) }
34
34
  def self.for(cls, rules)
35
35
  accessor_key = rules.fetch(:accessor_key)
36
36
  setter = rules.fetch(:setter_proc)
@@ -138,7 +138,7 @@ module T::Props
138
138
  # checked(:never) - We do this with `T.let` instead
139
139
  sig do
140
140
  params(
141
- cls: Module,
141
+ cls: T::Module[T.anything],
142
142
  factory: T.any(Proc, Method),
143
143
  accessor_key: Symbol,
144
144
  setter_proc: SetterFactory::SetterProc,
@@ -147,7 +147,7 @@ module T::Props
147
147
  .checked(:never)
148
148
  end
149
149
  def initialize(cls, factory, accessor_key, setter_proc)
150
- @class = T.let(cls, Module)
150
+ @class = T.let(cls, T::Module[T.anything])
151
151
  @factory = T.let(factory, T.any(Proc, Method))
152
152
  super(accessor_key, setter_proc)
153
153
  end
@@ -20,7 +20,7 @@ module T::Props
20
20
 
21
21
  NO_TRANSFORM_TYPES = T.let(
22
22
  [TrueClass, FalseClass, NilClass, Symbol, String].freeze,
23
- T::Array[Module],
23
+ T::Array[T::Module[T.anything]],
24
24
  )
25
25
  private_constant :NO_TRANSFORM_TYPES
26
26
 
@@ -151,7 +151,7 @@ module T::Props
151
151
  end
152
152
  end
153
153
 
154
- sig { params(varname: String, type: Module, mode: ModeType).returns(String).checked(:never) }
154
+ sig { params(varname: String, type: T::Module[T.anything], mode: ModeType).returns(String).checked(:never) }
155
155
  private_class_method def self.handle_serializable_subtype(varname, type, mode)
156
156
  case mode
157
157
  when Serialize
@@ -164,7 +164,7 @@ module T::Props
164
164
  end
165
165
  end
166
166
 
167
- sig { params(varname: String, type: Module, mode: ModeType).returns(String).checked(:never) }
167
+ sig { params(varname: String, type: T::Module[T.anything], mode: ModeType).returns(String).checked(:never) }
168
168
  private_class_method def self.handle_custom_type(varname, type, mode)
169
169
  case mode
170
170
  when Serialize
@@ -177,7 +177,7 @@ module T::Props
177
177
  end
178
178
  end
179
179
 
180
- sig { params(type: Module).returns(T.nilable(String)).checked(:never) }
180
+ sig { params(type: T::Module[T.anything]).returns(T.nilable(String)).checked(:never) }
181
181
  private_class_method def self.module_name(type)
182
182
  T::Configuration.module_name_mangler.call(type)
183
183
  end
@@ -12,7 +12,7 @@ module T::Props
12
12
 
13
13
  sig do
14
14
  params(
15
- klass: T.all(Module, T::Props::ClassMethods),
15
+ klass: T.all(T::Module[T.anything], T::Props::ClassMethods),
16
16
  prop: Symbol,
17
17
  rules: T::Hash[Symbol, T.untyped]
18
18
  )
@@ -53,8 +53,8 @@ module T::Props
53
53
  params(
54
54
  prop: Symbol,
55
55
  accessor_key: Symbol,
56
- non_nil_type: Module,
57
- klass: T.all(Module, T::Props::ClassMethods),
56
+ non_nil_type: T::Module[T.anything],
57
+ klass: T.all(T::Module[T.anything], T::Props::ClassMethods),
58
58
  )
59
59
  .returns([SetterProc, ValueValidationProc])
60
60
  end
@@ -89,7 +89,7 @@ module T::Props
89
89
  prop: Symbol,
90
90
  accessor_key: Symbol,
91
91
  non_nil_type: T::Types::Base,
92
- klass: T.all(Module, T::Props::ClassMethods),
92
+ klass: T.all(T::Module[T.anything], T::Props::ClassMethods),
93
93
  validate: T.nilable(ValidateProc)
94
94
  )
95
95
  .returns([SetterProc, ValueValidationProc])
@@ -138,8 +138,8 @@ module T::Props
138
138
  params(
139
139
  prop: Symbol,
140
140
  accessor_key: Symbol,
141
- non_nil_type: Module,
142
- klass: T.all(Module, T::Props::ClassMethods),
141
+ non_nil_type: T::Module[T.anything],
142
+ klass: T.all(T::Module[T.anything], T::Props::ClassMethods),
143
143
  )
144
144
  .returns([SetterProc, ValueValidationProc])
145
145
  end
@@ -174,7 +174,7 @@ module T::Props
174
174
  prop: Symbol,
175
175
  accessor_key: Symbol,
176
176
  non_nil_type: T::Types::Base,
177
- klass: T.all(Module, T::Props::ClassMethods),
177
+ klass: T.all(T::Module[T.anything], T::Props::ClassMethods),
178
178
  validate: T.nilable(ValidateProc),
179
179
  )
180
180
  .returns([SetterProc, ValueValidationProc])
@@ -225,9 +225,9 @@ module T::Props
225
225
 
226
226
  sig do
227
227
  params(
228
- klass: T.all(Module, T::Props::ClassMethods),
228
+ klass: T.all(T::Module[T.anything], T::Props::ClassMethods),
229
229
  prop: Symbol,
230
- type: T.any(T::Types::Base, Module),
230
+ type: T.any(T::Types::Base, T::Module[T.anything]),
231
231
  val: T.untyped,
232
232
  )
233
233
  .void
@@ -20,9 +20,9 @@ module T::Props::TypeValidation
20
20
  sig do
21
21
  params(
22
22
  name: T.any(Symbol, String),
23
- _cls: Module,
23
+ _cls: T::Module[T.anything],
24
24
  rules: T::Hash[Symbol, T.untyped],
25
- type: T.any(T::Types::Base, Module)
25
+ type: T.any(T::Types::Base, T::Module[T.anything])
26
26
  )
27
27
  .void
28
28
  .checked(:never)
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.6.12751
4
+ version: 0.6.12763
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-12 00:00:00.000000000 Z
11
+ date: 2025-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest