sorbet-runtime 0.5.12155 → 0.6.12632

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/types/_types.rb +1 -1
  3. data/lib/types/boolean.rb +1 -1
  4. data/lib/types/configuration.rb +4 -14
  5. data/lib/types/enum.rb +35 -35
  6. data/lib/types/non_forcing_constants.rb +1 -1
  7. data/lib/types/private/abstract/data.rb +1 -1
  8. data/lib/types/private/methods/_methods.rb +21 -5
  9. data/lib/types/private/methods/call_validation.rb +3 -16
  10. data/lib/types/private/methods/decl_builder.rb +6 -1
  11. data/lib/types/private/methods/signature.rb +8 -8
  12. data/lib/types/private/methods/signature_validation.rb +42 -3
  13. data/lib/types/private/mixins/mixins.rb +1 -1
  14. data/lib/types/private/runtime_levels.rb +1 -1
  15. data/lib/types/private/sealed.rb +5 -5
  16. data/lib/types/props/_props.rb +6 -9
  17. data/lib/types/props/constructor.rb +1 -1
  18. data/lib/types/props/custom_type.rb +5 -5
  19. data/lib/types/props/decorator.rb +127 -64
  20. data/lib/types/props/generated_code_validation.rb +4 -4
  21. data/lib/types/props/has_lazily_specialized_methods.rb +13 -13
  22. data/lib/types/props/optional.rb +2 -2
  23. data/lib/types/props/pretty_printable.rb +6 -6
  24. data/lib/types/props/private/apply_default.rb +15 -15
  25. data/lib/types/props/private/deserializer_generator.rb +10 -6
  26. data/lib/types/props/private/serde_transform.rb +8 -8
  27. data/lib/types/props/private/serializer_generator.rb +9 -5
  28. data/lib/types/props/private/setter_factory.rb +4 -4
  29. data/lib/types/props/serializable.rb +14 -19
  30. data/lib/types/props/type_validation.rb +5 -5
  31. data/lib/types/props/utils.rb +1 -1
  32. data/lib/types/props/weak_constructor.rb +3 -3
  33. data/lib/types/sig.rb +2 -2
  34. data/lib/types/struct.rb +2 -2
  35. data/lib/types/types/base.rb +6 -6
  36. data/lib/types/types/fixed_array.rb +1 -1
  37. data/lib/types/types/fixed_hash.rb +6 -6
  38. data/lib/types/types/intersection.rb +2 -2
  39. data/lib/types/types/t_enum.rb +2 -0
  40. data/lib/types/types/union.rb +7 -7
  41. metadata +3 -3
@@ -44,11 +44,11 @@ module T::Types
44
44
  nilable = T::Utils.coerce(NilClass)
45
45
  trueclass = T::Utils.coerce(TrueClass)
46
46
  falseclass = T::Utils.coerce(FalseClass)
47
- if types.any? {|t| t == nilable}
48
- remaining_types = types.reject {|t| t == nilable}
47
+ if types.any? { |t| t == nilable }
48
+ remaining_types = types.reject { |t| t == nilable }
49
49
  "T.nilable(#{type_shortcuts(remaining_types)})"
50
- elsif types.any? {|t| t == trueclass} && types.any? {|t| t == falseclass}
51
- remaining_types = types.reject {|t| t == trueclass || t == falseclass}
50
+ elsif types.any? { |t| t == trueclass } && types.any? { |t| t == falseclass }
51
+ remaining_types = types.reject { |t| t == trueclass || t == falseclass }
52
52
  type_shortcuts([T::Private::Types::StringHolder.new("T::Boolean")] + remaining_types)
53
53
  else
54
54
  names = types.map(&:name).compact.sort
@@ -58,12 +58,12 @@ module T::Types
58
58
 
59
59
  # overrides Base
60
60
  def recursively_valid?(obj)
61
- types.any? {|type| type.recursively_valid?(obj)}
61
+ types.any? { |type| type.recursively_valid?(obj) }
62
62
  end
63
63
 
64
64
  # overrides Base
65
65
  def valid?(obj)
66
- types.any? {|type| type.valid?(obj)}
66
+ types.any? { |type| type.valid?(obj) }
67
67
  end
68
68
 
69
69
  # overrides Base
@@ -72,7 +72,7 @@ module T::Types
72
72
  end
73
73
 
74
74
  def unwrap_nilable
75
- non_nil_types = types.reject {|t| t == T::Utils::Nilable::NIL_TYPE}
75
+ non_nil_types = types.reject { |t| t == T::Utils::Nilable::NIL_TYPE }
76
76
  return nil if types.length == non_nil_types.length
77
77
  case non_nil_types.length
78
78
  when 0 then nil
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.12155
4
+ version: 0.6.12632
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-05 00:00:00.000000000 Z
11
+ date: 2025-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -256,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
256
256
  requirements:
257
257
  - - ">="
258
258
  - !ruby/object:Gem::Version
259
- version: 2.7.0
259
+ version: 3.0.0
260
260
  required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - ">="