sorbet-runtime 0.4.4544 → 0.4.4547
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 +4 -4
- data/lib/types/helpers.rb +4 -0
- data/lib/types/private/abstract/declare.rb +2 -2
- data/lib/types/private/final.rb +6 -6
- data/lib/types/private/methods/_methods.rb +3 -3
- 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: 5f4bce09e0cc881acc74117d2c0400d4e1d3d3e2
|
4
|
+
data.tar.gz: 77dabc01e006f64f6000b4febe37a7dba4f1cb85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 638f20f306ac1a0e8a2b7612f29abe9f36ee665b58192ff3d61819fee1030deb12f93d8929a8c01240db538bd30eddf0a8e02e972ada9b021ae74b1a26739946
|
7
|
+
data.tar.gz: f6006d286a437e5ad3c7dedf0aa55343116754e4a2f483a8ff0c8c5e41b1cc37078c0860ae96c7ce505cf4ecbbb5b50476b75e57fd9a371998f45850b1f5c894
|
data/lib/types/helpers.rb
CHANGED
@@ -20,6 +20,10 @@ module T::Helpers
|
|
20
20
|
Private::Final.declare(self)
|
21
21
|
end
|
22
22
|
|
23
|
+
def sealed!
|
24
|
+
Kernel.raise "TODO(jez) sealed is not implemented in the runtime yet."
|
25
|
+
end
|
26
|
+
|
23
27
|
# Causes a mixin to also mix in class methods from the named module.
|
24
28
|
#
|
25
29
|
# Nearly equivalent to
|
@@ -7,10 +7,10 @@ module T::Private::Abstract::Declare
|
|
7
7
|
|
8
8
|
def self.declare_abstract(mod, type:)
|
9
9
|
if AbstractUtils.abstract_module?(mod)
|
10
|
-
raise "#{mod
|
10
|
+
raise "#{mod} is already declared as abstract"
|
11
11
|
end
|
12
12
|
if T::Private::Final.final_module?(mod)
|
13
|
-
raise "#{mod
|
13
|
+
raise "#{mod} was already declared as final and cannot be declared as abstract"
|
14
14
|
end
|
15
15
|
|
16
16
|
Abstract::Data.set(mod, :can_have_abstract_methods, true)
|
data/lib/types/private/final.rb
CHANGED
@@ -5,31 +5,31 @@ module T::Private::Final
|
|
5
5
|
module NoInherit
|
6
6
|
def inherited(arg)
|
7
7
|
super(arg)
|
8
|
-
raise "#{self
|
8
|
+
raise "#{self} was declared as final and cannot be inherited"
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
module NoIncludeExtend
|
13
13
|
def included(arg)
|
14
14
|
super(arg)
|
15
|
-
raise "#{self
|
15
|
+
raise "#{self} was declared as final and cannot be included"
|
16
16
|
end
|
17
17
|
|
18
18
|
def extended(arg)
|
19
19
|
super(arg)
|
20
|
-
raise "#{self
|
20
|
+
raise "#{self} was declared as final and cannot be extended"
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.declare(mod)
|
25
25
|
if !mod.is_a?(Module)
|
26
|
-
raise "#{mod
|
26
|
+
raise "#{mod} is not a class or module and cannot be declared as final with `final!`"
|
27
27
|
end
|
28
28
|
if final_module?(mod)
|
29
|
-
raise "#{mod
|
29
|
+
raise "#{mod} was already declared as final and cannot be re-declared as final"
|
30
30
|
end
|
31
31
|
if T::AbstractUtils.abstract_module?(mod)
|
32
|
-
raise "#{mod
|
32
|
+
raise "#{mod} was already declared as abstract and cannot be declared as final"
|
33
33
|
end
|
34
34
|
mod.extend(mod.is_a?(Class) ? NoInherit : NoIncludeExtend)
|
35
35
|
mark_as_final_module(mod)
|
@@ -144,8 +144,8 @@ module T::Private::Methods
|
|
144
144
|
# directly on ancestor but instead an ancestor of ancestor.
|
145
145
|
if ancestor.method_defined?(method_name) && final_method?(method_owner_and_name_to_key(ancestor, method_name))
|
146
146
|
raise(
|
147
|
-
"`#{
|
148
|
-
(target == ancestor ? "redefined" : "overridden in
|
147
|
+
"The method `#{method_name}` on #{ancestor} was declared as final and cannot be " +
|
148
|
+
(target == ancestor ? "redefined" : "overridden in #{target}")
|
149
149
|
)
|
150
150
|
end
|
151
151
|
end
|
@@ -179,7 +179,7 @@ module T::Private::Methods
|
|
179
179
|
mod = is_singleton_method ? hook_mod.singleton_class : hook_mod
|
180
180
|
|
181
181
|
if T::Private::Final.final_module?(mod) && (current_declaration.nil? || !current_declaration.final)
|
182
|
-
raise "
|
182
|
+
raise "#{mod} was declared as final but its method `#{method_name}` was not declared as final"
|
183
183
|
end
|
184
184
|
_check_final_ancestors(mod, mod.ancestors, [method_name])
|
185
185
|
|
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.4547
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|