sorbet-runtime 0.5.10780 → 0.5.10782
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sorbet-runtime.rb +1 -0
- data/lib/types/_types.rb +4 -0
- data/lib/types/types/anything.rb +31 -0
- data/lib/types/types/base.rb +4 -0
- data/lib/types/types/noreturn.rb +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 775572c19008cfccf4857dea03c7a20af6425eeb6e9c252d7411b6d07b102bd7
|
4
|
+
data.tar.gz: 4372ece549f9e340865242ad15e0b3d1bb4ecf5e1532f1867bc7d315a4ae95ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df20b3fbeb6e4d7c2abafcb49d029d35acc6c4c3c4a94768b32653d9c5377726db173c7f93719549c4271baddf74d7736ab2d90c4543cb0116cd59a355f7535b
|
7
|
+
data.tar.gz: 15d21f62ed38ce9cd1c132b63e4639ab19aed9c29abe2bfbb79fbdbf10d0372abdc8595b748110fe33f7cdf83b65cdaa034e64a55e9267d2e46fed53e790fda1
|
data/lib/sorbet-runtime.rb
CHANGED
@@ -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
|
data/lib/types/types/base.rb
CHANGED
data/lib/types/types/noreturn.rb
CHANGED
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.
|
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-
|
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
|