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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/types/_types.rb +18 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75ebf9d436d6406fef983f5eb3051e3f3a33e92a
4
- data.tar.gz: 7d4b6fc4cb63cc3fb5def893808a9f7490931cca
3
+ metadata.gz: fc2f18425d1a978318e882adfde65b3131f6f5b4
4
+ data.tar.gz: b27069b61f58c3fe2ce0676d89157d15963224c8
5
5
  SHA512:
6
- metadata.gz: fe94a71f8b58ce23a9f063ea0b37dfc79466b30a0e348bbc252dc94935bf46baef6d253d8de295a3afba814425d5f2536e18714b35b68ee22fdf6dbe3535bd4f
7
- data.tar.gz: efee703af351ec955db129b678f9c11594956444cd22645b92bb177081e371d3cfd6659a7b60e8e69f5567dd43f5871d5f92d18524d992a1d47992bc5ec3c5d6
6
+ metadata.gz: de7d056146ff86b29d97bf085e45e8026a65d69557792b90cd2374ba0ce20efadf3a72ec37e4808dd94863c600172de4b4bf8aa28264d59b0ce8b1ae40b28847
7
+ data.tar.gz: 7c3313b0aae49098b99ca494aef69615132e93edf3637eb565d7858af369759373678927a5cf9d9a93e3c66287a9b64c485b1be740f853ee00b7394797562ee1
@@ -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.4493
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-23 00:00:00.000000000 Z
11
+ date: 2019-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest