sorbet-runtime 0.5.10780 → 0.5.10783

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: 31239463630de70549f832a1a15e4c2d2b59ef7d1cfa692ae056af54a6cf2d44
4
- data.tar.gz: 8f324b78b4c1d4b41532f658d147fa90428276c2896db228795280c5ac99eafa
3
+ metadata.gz: 2c26b0ec87fd4ba51b73c584e3a2d8f93510c2ebfe163b3c530adc421f2063d3
4
+ data.tar.gz: 4be03d3968417df3418c0d518c12054cc873ff2a4b57ec51ec6f1bf2a8af479f
5
5
  SHA512:
6
- metadata.gz: 015a19f9d00ea39db31c513736644c9e762d95f7a1fbb8c609c064307c124de3ee6bf7f63406341bb6fabc86952e79fb4c3f0d830e8c7f8193e8726fdac4e669
7
- data.tar.gz: cc9161f03c78e9c89e73ffd18ed1402e1998a90aa1996d2a3cb2cb9381db4b123c55ca7897a6b7ffbe22d81b83cab0f89c75c4412724337c34dd0811b5f10f37
6
+ metadata.gz: a8cb11cd914f31dcb52fb06238f692f8340a1c470ed305ce9d5e344fbc36e5786cca6614bc8967e79247a7a61582cfc01622d805777b1e3ec0ddc57e5927ff3e
7
+ data.tar.gz: 0e5caab9c74cc762a2754399b0cf0f7f2c63c241b1d5bec5a1a395427a8cd33a5989491301e96ea2a17e0a2faf39f58b0e8d139e513dbdc4fb3727c6bcb5a8d7
@@ -37,6 +37,7 @@ require_relative 'types/types/fixed_array'
37
37
  require_relative 'types/types/fixed_hash'
38
38
  require_relative 'types/types/intersection'
39
39
  require_relative 'types/types/noreturn'
40
+ require_relative 'types/types/anything'
40
41
  require_relative 'types/types/proc'
41
42
  require_relative 'types/types/attached_class'
42
43
  require_relative 'types/types/self_type'
data/lib/types/_types.rb CHANGED
@@ -47,6 +47,10 @@ module T
47
47
  T::Types::NoReturn::Private::INSTANCE
48
48
  end
49
49
 
50
+ def self.anything
51
+ T::Types::Anything::Private::INSTANCE
52
+ end
53
+
50
54
  # T.all(<Type>, <Type>, ...) -- matches an object that has all of the types listed
51
55
  def self.all(type_a, type_b, *types)
52
56
  T::Types::Intersection.new([type_a, type_b] + types)
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+ # typed: true
3
+
4
+ module T::Types
5
+ # The top type
6
+ class Anything < Base
7
+ def initialize; end
8
+
9
+ # overrides Base
10
+ def name
11
+ "T.anything"
12
+ end
13
+
14
+ # overrides Base
15
+ def valid?(obj)
16
+ true
17
+ end
18
+
19
+ # overrides Base
20
+ private def subtype_of_single?(other)
21
+ case other
22
+ when T::Types::Anything then true
23
+ else false
24
+ end
25
+ end
26
+
27
+ module Private
28
+ INSTANCE = Anything.new.freeze
29
+ end
30
+ end
31
+ end
@@ -50,6 +50,10 @@ module T::Types
50
50
  t2 = t2.aliased_type
51
51
  end
52
52
 
53
+ if t2.is_a?(T::Types::Anything)
54
+ return true
55
+ end
56
+
53
57
  if t1.is_a?(T::Private::Types::TypeAlias)
54
58
  return t1.aliased_type.subtype_of?(t2)
55
59
  end
@@ -4,7 +4,6 @@
4
4
  module T::Types
5
5
  # The bottom type
6
6
  class NoReturn < Base
7
-
8
7
  def initialize; end
9
8
 
10
9
  # overrides Base
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.10780
4
+ version: 0.5.10783
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-14 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -215,6 +215,7 @@ files:
215
215
  - lib/types/props/weak_constructor.rb
216
216
  - lib/types/sig.rb
217
217
  - lib/types/struct.rb
218
+ - lib/types/types/anything.rb
218
219
  - lib/types/types/attached_class.rb
219
220
  - lib/types/types/base.rb
220
221
  - lib/types/types/class_of.rb