sorbet-runtime 0.5.5818 → 0.5.5835

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: e8d41af5253e7cb24919290d89ab85c5606395fbbb5c7193dbccfd3b6752f6d1
4
- data.tar.gz: dabe899c6ea327c7b4f414a7f71f10487095388ccd4fe930eff6a625eccd2633
3
+ metadata.gz: 1c78c486ad11e0c1425ad311f09498c7932e29d5dc95ecd3b39d497706d918ba
4
+ data.tar.gz: c465da35e7c4a3327b4f8b2b29854f45aecfb2dfabc7863245cd82028371101a
5
5
  SHA512:
6
- metadata.gz: e1d9d77ca1987117dba6229663093165da8d6ada05ff943d600a1f84392179513571a8be81e3712384d3bd499460bef6a64da4e1b585e4b6051198ad51023f72
7
- data.tar.gz: 4bed940ba725ad4b659d2b0578885a18d914a1d12d979578ba2d19673842831497c2d713b1de2717decb341823053f2881ba4bc9f33ef5095a80d3839d974567
6
+ metadata.gz: f92f74be1bb881101fab6440467307a370d063d458da5014ebfed3f768cfac7c829bcbb4200492d48d49d0d1c03d4652c4cfc9fb67edd64fc54643972a0ff332
7
+ data.tar.gz: 0ff90148441a61f9cf1911fac9c6e91e065b927bb3d68a423c0371f765e11c00e4bbe3eef1b639c443603ea62a0a79ee6807ce5d54a1ab35d5bda38c23675b66
@@ -37,12 +37,12 @@ module T
37
37
  # Matches any object. In the static checker, T.untyped allows any
38
38
  # method calls or operations.
39
39
  def self.untyped
40
- T::Types::Untyped.new
40
+ T::Types::Untyped::Private::INSTANCE
41
41
  end
42
42
 
43
43
  # Indicates a function never returns (e.g. "Kernel#raise")
44
44
  def self.noreturn
45
- T::Types::NoReturn.new
45
+ T::Types::NoReturn::Private::INSTANCE
46
46
  end
47
47
 
48
48
  # T.all(<Type>, <Type>, ...) -- matches an object that has all of the types listed
@@ -62,12 +62,12 @@ module T
62
62
 
63
63
  # Matches `self`:
64
64
  def self.self_type
65
- T::Types::SelfType.new
65
+ T::Types::SelfType::Private::INSTANCE
66
66
  end
67
67
 
68
68
  # Matches the instance type in a singleton-class context
69
69
  def self.attached_class
70
- T::Types::AttachedClassType.new
70
+ T::Types::AttachedClassType::Private::INSTANCE
71
71
  end
72
72
 
73
73
  # Matches any class that subclasses or includes the provided class
@@ -10,7 +10,11 @@ module T::Profile
10
10
  def typecheck_duration_estimate
11
11
  total_typechecks = typecheck_samples * SAMPLE_RATE + (SAMPLE_RATE - typecheck_sample_attempts)
12
12
  typechecks_measured = typecheck_samples * SAMPLE_RATE
13
- typecheck_duration * SAMPLE_RATE * 1.0 * total_typechecks / typechecks_measured
13
+ if typechecks_measured.positive?
14
+ typecheck_duration * SAMPLE_RATE * 1.0 * total_typechecks / typechecks_measured
15
+ else
16
+ 0.0
17
+ end
14
18
  end
15
19
 
16
20
  def typecheck_count_estimate
@@ -29,5 +29,9 @@ module T::Types
29
29
  false
30
30
  end
31
31
  end
32
+
33
+ module Private
34
+ INSTANCE = AttachedClassType.new.freeze
35
+ end
32
36
  end
33
37
  end
@@ -21,5 +21,9 @@ module T::Types
21
21
  private def subtype_of_single?(other)
22
22
  true
23
23
  end
24
+
25
+ module Private
26
+ INSTANCE = NoReturn.new.freeze
27
+ end
24
28
  end
25
29
  end
@@ -27,5 +27,9 @@ module T::Types
27
27
  false
28
28
  end
29
29
  end
30
+
31
+ module Private
32
+ INSTANCE = SelfType.new.freeze
33
+ end
30
34
  end
31
35
  end
@@ -44,11 +44,7 @@ module T::Types
44
44
 
45
45
  # @override Base
46
46
  def valid?(obj)
47
- @types.each do |type|
48
- return true if type.valid?(obj)
49
- end
50
-
51
- false
47
+ @types.any? {|type| type.valid?(obj)}
52
48
  end
53
49
 
54
50
  # @override Base
@@ -21,5 +21,9 @@ module T::Types
21
21
  private def subtype_of_single?(other)
22
22
  true
23
23
  end
24
+
25
+ module Private
26
+ INSTANCE = Untyped.new.freeze
27
+ end
24
28
  end
25
29
  end
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.5818
4
+ version: 0.5.5835
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-14 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest