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 +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: 2c26b0ec87fd4ba51b73c584e3a2d8f93510c2ebfe163b3c530adc421f2063d3
|
4
|
+
data.tar.gz: 4be03d3968417df3418c0d518c12054cc873ff2a4b57ec51ec6f1bf2a8af479f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8cb11cd914f31dcb52fb06238f692f8340a1c470ed305ce9d5e344fbc36e5786cca6614bc8967e79247a7a61582cfc01622d805777b1e3ec0ddc57e5927ff3e
|
7
|
+
data.tar.gz: 0e5caab9c74cc762a2754399b0cf0f7f2c63c241b1d5bec5a1a395427a8cd33a5989491301e96ea2a17e0a2faf39f58b0e8d139e513dbdc4fb3727c6bcb5a8d7
|
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.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-
|
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
|