sorbet-runtime 0.4.4907 → 0.4.4921

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5760ee1a6293acbbe98e07c7a6ddafa7bc45b3985b22ff1974c5cbd948a3b49e
4
- data.tar.gz: 70ca041972473990dcefbd87625a363c98c6adcdb655e99d5797ab667393a908
3
+ metadata.gz: 0d40e26cedcbf0dc8b79fea1ca262f08321d206aa7b37f377a9f826435d24865
4
+ data.tar.gz: 9e109ea63882dfb5324169af7c7fed036980c46299d7b4d7ca4aafc3ee2210ec
5
5
  SHA512:
6
- metadata.gz: 8e94d5fbe0e8de6f1c3e1dcfc59454f452e3be1f8188172b4f85c2a81e79582ab4125f7ba6b7827e76639e7462db7193480654cfb212d4abb4b3984479097cbf
7
- data.tar.gz: 5a2cdb278bf0935a666a0fffedb4a182cf1e076ea1c8a5776d0f0ed6ed84c2b9b0063a14c4569fbca7b23f86890ce4737901985f30e878e20f280ff4c31980df
6
+ metadata.gz: bf08e0eeb6a5c8ec072db55db232853b182d4fa78a4737e11b580407edaf52b9449db837112890c25746d7e643392f7691b9569cc6e4fcca08671edcfdde35d8
7
+ data.tar.gz: a31ff3766becffc2d1432e61473d264f5b2f60508e8260c99c2da5ba54621234f275067c955a8e3995120842496a47eeca8caa6843d44b5aad47368e3c8a8f3e
@@ -46,13 +46,8 @@ module T::Types
46
46
  return false if !key_type.valid?(key) || !value_type.valid?(val)
47
47
  end
48
48
  return true
49
- when Enumerator::Lazy
50
- # Users don't want these walked
51
- return true
52
49
  when Enumerator
53
- obj.each do |elem|
54
- return false unless @type.valid?(elem)
55
- end
50
+ # Enumerators can be unbounded: see `[:foo, :bar].cycle`
56
51
  return true
57
52
  when Range
58
53
  @type.valid?(obj.first) && @type.valid?(obj.last)
data/lib/types/utils.rb CHANGED
@@ -32,6 +32,9 @@ module T::Utils
32
32
  T::Types::OpusEnum.new(val) # rubocop:disable PrisonGuard/UseOpusTypesShortcut
33
33
  elsif defined?(::T::Enum) && val.is_a?(::T::Enum)
34
34
  T::Types::OpusEnum.new(val) # rubocop:disable PrisonGuard/UseOpusTypesShortcut
35
+ elsif val.is_a?(::String)
36
+ raise "Invalid String literal for type constraint. Must be an #{T::Types::Base}, a " \
37
+ "class/module, or an array. Got a String with value `#{val}`."
35
38
  else
36
39
  raise "Invalid value for type constraint. Must be an #{T::Types::Base}, a " \
37
40
  "class/module, or an array. Got a `#{val.class}`."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4907
4
+ version: 0.4.4921
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe