sorbet-coerce 0.1.2 → 0.1.3

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: e72cc347e68ca6df5bfd3378ec9482aa1463c43cf9f03f203f110cbde5da4e6f
4
- data.tar.gz: c22aa7e85408cd2306d3cf582382ef5aac8c49873bd250f77fa17f4fa4cc91ec
3
+ metadata.gz: 5aa2115660631b882945bc26ce5ac623482cefcce7f7c54286111a1094340466
4
+ data.tar.gz: fd8d9ff4289975b73fc64cb342c32abfe859bc5cc8e1e81f9022b96112b5b028
5
5
  SHA512:
6
- metadata.gz: c2a1141237ad7bc7bb666d50c03b2b4c7507789236ae2e0542d50603e7bdf1cc353a4d5faf9bbc10f1927a81bed6887715078e5252842bd10648f5e38224d49a
7
- data.tar.gz: 0d82e8842ee6cbac0aefd823f023f71128088d414681a4600dc1c7b025c92c1010673b3334123d9a4c64a4315a26b39ea64f6f507ff010f9518799a9aad17519
6
+ metadata.gz: 5afed20eef79f73b1b2a0f0fa21a9619ddee55a64be7f7103b3f54ce2fe0d8148de702234f27884b0ab465644747328995f71b55a2a57b34bd690daf35b50fd5
7
+ data.tar.gz: b9bb17aa9c66f72c9ee3be9cf5eb6b33554e64d18675a64f592b2f64bab2354136582afc8abc594e1743873b7187174ad0d49c18c5065ee5fa52abe9445a2b98
@@ -53,11 +53,14 @@ module T::Private
53
53
  else
54
54
  _convert(value, type.types[nil_idx == 0 ? 1 : 0])
55
55
  end
56
+ elsif Object.const_defined?('T::Private::Types::TypeAlias') &&
57
+ type.is_a?(T::Private::Types::TypeAlias)
58
+ _convert(value, type.aliased_type)
56
59
  elsif type < T::Struct
57
60
  args = _build_args(value, type.props)
58
61
  begin
59
62
  type.new(args)
60
- rescue T::Props::InvalidValueError, ArgumentError
63
+ rescue
61
64
  nil
62
65
  end
63
66
  else
@@ -1,5 +1,4 @@
1
- # typed: strong
2
-
1
+ # typed: true
3
2
  module T
4
3
  module Coerce
5
4
  extend T::Sig
@@ -10,4 +9,12 @@ module T
10
9
  sig { params(args: T.untyped).returns(Elem) }
11
10
  def from(args); end
12
11
  end
12
+
13
+ module Private
14
+ module Types
15
+ class TypeAlias
16
+ def aliased_type; end
17
+ end
18
+ end
19
+ end
13
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-coerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chan Zuckerberg Initiative