sorbet-runtime 0.4.4858 → 0.4.4865

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: 396a3ef8dbe8e6e9cd7afd03431befad0b6e0796014cc2d9fc0c37552fd9d08c
4
- data.tar.gz: 295f887fb11d863278d9261a68cc64cffc79ea81fea7f9f6afa8ca8dc24b642d
3
+ metadata.gz: 94a18cf9e2e1f9f37174616403474310fed12cf369517e901f7769a231cfab38
4
+ data.tar.gz: 70b8cf1a76942f9a4371370dfb92cba1f08c72022cce060bd217cab5c9af502c
5
5
  SHA512:
6
- metadata.gz: 3030d34ade9efeab779e468fca172338617fd32862301d8c6d0912e96d7cff392294ad33379b47137e247024b4b2a8661bd9bea10259ee8b1e16badf8a9ea666
7
- data.tar.gz: 8818469584b79640e003a739b18094d67b3871ed0c62cd072d3d8c304a4aefedecdd8bc4ce59d15beec94becd057f33eb3df0cea5e0a51642ed152eb825d8e67
6
+ metadata.gz: 2854f99897e4859cc5fdfe3d27bc7f93038096be1ce63bbdab097fa44e45e98a3ff31e550808a11ea41f6e4e71a576b3bc2c6e9188645bbd081e9e7181f07b7b
7
+ data.tar.gz: bb1ee9d0eb130e64274a8b6c831fd573998df9a7f77f8c1541287cd02f738233a726cf196bbc2819dc36ac7d2eed4bd97ab986e14700dd35bbb821e48bffec37
@@ -42,6 +42,7 @@ require_relative 'types/types/fixed_hash'
42
42
  require_relative 'types/types/intersection'
43
43
  require_relative 'types/types/noreturn'
44
44
  require_relative 'types/types/proc'
45
+ require_relative 'types/types/attached_class'
45
46
  require_relative 'types/types/self_type'
46
47
  require_relative 'types/types/simple'
47
48
  require_relative 'types/types/opus_enum'
@@ -65,6 +65,11 @@ module T
65
65
  T::Types::SelfType.new
66
66
  end
67
67
 
68
+ # Matches the instance type in a singleton-class context
69
+ def self.experimental_attached_class
70
+ T::Types::AttachedClassType.new
71
+ end
72
+
68
73
  # Matches any class that subclasses or includes the provided class
69
74
  # or module
70
75
  def self.class_of(klass)
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ # typed: true
3
+
4
+ module T::Types
5
+ # Modeling AttachedClass properly at runtime would require additional
6
+ # tracking, so at runtime we permit all values and rely on the static checker.
7
+ # As AttachedClass is modeled statically as a type member on every singleton
8
+ # class, this is consistent with the runtime behavior for all type members.
9
+ class AttachedClassType < Base
10
+
11
+ def initialize(); end
12
+
13
+ # @override Base
14
+ def name
15
+ "AttachedClass"
16
+ end
17
+
18
+ # @override Base
19
+ def valid?(obj)
20
+ true
21
+ end
22
+
23
+ # @override Base
24
+ private def subtype_of_single?(other)
25
+ case other
26
+ when AttachedClassType
27
+ true
28
+ else
29
+ false
30
+ end
31
+ end
32
+ end
33
+ 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.4.4858
4
+ version: 0.4.4865
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-11 00:00:00.000000000 Z
11
+ date: 2019-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -117,6 +117,7 @@ files:
117
117
  - lib/types/runtime_profiled.rb
118
118
  - lib/types/sig.rb
119
119
  - lib/types/struct.rb
120
+ - lib/types/types/attached_class.rb
120
121
  - lib/types/types/base.rb
121
122
  - lib/types/types/class_of.rb
122
123
  - lib/types/types/enum.rb