sorbet-runtime 0.4.4493 → 0.4.4494
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/types/_types.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc2f18425d1a978318e882adfde65b3131f6f5b4
|
4
|
+
data.tar.gz: b27069b61f58c3fe2ce0676d89157d15963224c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de7d056146ff86b29d97bf085e45e8026a65d69557792b90cd2374ba0ce20efadf3a72ec37e4808dd94863c600172de4b4bf8aa28264d59b0ce8b1ae40b28847
|
7
|
+
data.tar.gz: 7c3313b0aae49098b99ca494aef69615132e93edf3637eb565d7858af369759373678927a5cf9d9a93e3c66287a9b64c485b1be740f853ee00b7394797562ee1
|
data/lib/types/_types.rb
CHANGED
@@ -195,6 +195,24 @@ module T
|
|
195
195
|
value
|
196
196
|
end
|
197
197
|
|
198
|
+
# A way to ask Sorbet to prove that a certain branch of control flow never
|
199
|
+
# happens. Commonly used to assert that a case or if statement exhausts all
|
200
|
+
# possible cases.
|
201
|
+
def self.absurd(value)
|
202
|
+
msg = "Control flow reached T.absurd."
|
203
|
+
|
204
|
+
case value
|
205
|
+
when Kernel
|
206
|
+
msg += " Got value: #{value}"
|
207
|
+
end
|
208
|
+
|
209
|
+
begin
|
210
|
+
raise TypeError.new(msg)
|
211
|
+
rescue TypeError => e # raise into rescue to ensure e.backtrace is populated
|
212
|
+
T::Private::ErrorHandler.handle_inline_type_error(e)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
198
216
|
### Generic classes ###
|
199
217
|
|
200
218
|
module Array
|
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.4.
|
4
|
+
version: 0.4.4494
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|