sorbet-runtime 0.4.4269 → 0.4.4270

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86c9e783b28d05d9fbd659be64343631fbb0208e
4
- data.tar.gz: 2c7f6ef2fd5d991250e48c857166f9b0d67e49ec
3
+ metadata.gz: f7e77f608cdc5b50f04e11fa6e9c9922878d0dbd
4
+ data.tar.gz: 5e658c10c0ffdaa4f6116f5619392b517b0fcac9
5
5
  SHA512:
6
- metadata.gz: 07d7c038416571d45d36c1985b0b8bef90964f0b98534d790db31532e7cdae9003d81bd89af98b92f6e8435a25b07beb06b2119681b8d81fc1fead87a4c19f58
7
- data.tar.gz: 8b808fd4a8ae4c0d33a48583c9f64509d85928a1591844980b41eb0dd2e47b14a116d0a169dcced3ce2632646035c533e58afdfd86c3fb2f654e2d4d48572aa8
6
+ metadata.gz: 82273cec61baba7ae992fe7c99b9a73eea2a69c41eca906191a3b009d76bea02d35b5a89eb75f902f757e569c5a3467be5287630bac26794250879982a26ddbe
7
+ data.tar.gz: ebe1ae4d6ed52246350ef002d4db1e395b96043a0a42bf07892efd4e0cd92c569cb2c38f790c9d869a27fae93be8fad87a9ec6a86ad5b2e45c53412f6098dc86
@@ -18,6 +18,10 @@ module T::Private::Abstract::Declare
18
18
  mod.extend(T::InterfaceWrapper::Helpers)
19
19
 
20
20
  if mod.is_a?(Class)
21
+ if mod < T::Struct
22
+ raise "#{mod.name} is a subclass of T::Struct and cannot be declared abstract"
23
+ end
24
+
21
25
  if type == :interface
22
26
  # Since `interface!` is just `abstract!` with some extra validation, we could technically
23
27
  # allow this, but it's unclear there are good use cases, and it might be confusing.
@@ -1,8 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
  # typed: true
3
3
 
4
- class T::Struct
4
+ class T::InexactStruct
5
5
  include T::Props
6
6
  include T::Props::Serializable
7
7
  include T::Props::Constructor
8
8
  end
9
+
10
+ class T::Struct < T::InexactStruct
11
+ def self.inherited(subclass)
12
+ super(subclass)
13
+ T::Private::ClassUtils.replace_method(subclass.singleton_class, :inherited) do |s|
14
+ super(s)
15
+ raise "#{self.name} is a subclass of T::Struct and cannot be subclassed"
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4269
4
+ version: 0.4.4270
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe