sorbet-runtime 0.5.10780 → 0.5.10782

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: 31239463630de70549f832a1a15e4c2d2b59ef7d1cfa692ae056af54a6cf2d44
4
- data.tar.gz: 8f324b78b4c1d4b41532f658d147fa90428276c2896db228795280c5ac99eafa
3
+ metadata.gz: 775572c19008cfccf4857dea03c7a20af6425eeb6e9c252d7411b6d07b102bd7
4
+ data.tar.gz: 4372ece549f9e340865242ad15e0b3d1bb4ecf5e1532f1867bc7d315a4ae95ca
5
5
  SHA512:
6
- metadata.gz: 015a19f9d00ea39db31c513736644c9e762d95f7a1fbb8c609c064307c124de3ee6bf7f63406341bb6fabc86952e79fb4c3f0d830e8c7f8193e8726fdac4e669
7
- data.tar.gz: cc9161f03c78e9c89e73ffd18ed1402e1998a90aa1996d2a3cb2cb9381db4b123c55ca7897a6b7ffbe22d81b83cab0f89c75c4412724337c34dd0811b5f10f37
6
+ metadata.gz: df20b3fbeb6e4d7c2abafcb49d029d35acc6c4c3c4a94768b32653d9c5377726db173c7f93719549c4271baddf74d7736ab2d90c4543cb0116cd59a355f7535b
7
+ data.tar.gz: 15d21f62ed38ce9cd1c132b63e4639ab19aed9c29abe2bfbb79fbdbf10d0372abdc8595b748110fe33f7cdf83b65cdaa034e64a55e9267d2e46fed53e790fda1
@@ -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.10782
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-15 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