sorbet-runtime 0.5.11690 → 0.5.12067
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/private/methods/call_validation.rb +18 -14
- data/lib/types/private/sealed.rb +2 -2
- data/lib/types/props/decorator.rb +4 -2
- data/lib/types/types/class_of.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cabf74bc5ad63d319702fb59f0df2d8b4b15b82f7c3a2e17d45b5ff338874ef
|
4
|
+
data.tar.gz: b774dd7d82539b635ac56d49a029d0cb6c0239f5a3a2617df1e0ba95de25fdc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75bf5bcdff9c96856a9a44e1647018c12a6010a7ecdb802e0d0cfc37d545a5407ac676b754947b07077a1e59cfa18d0c09a1bee3f2de9d2de444dae6ed7f220e
|
7
|
+
data.tar.gz: e63fce326fe421d2f28811a7d770a546630bc056ecd125bd92e3de093953243a1a8d348fb9d0afdc554a54dc3051d74209bf29c02245019ce0a0fa7034e4d5f6
|
@@ -46,21 +46,25 @@ module T::Private::Methods::CallValidation
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.create_abstract_wrapper(mod, method_sig, original_method, original_visibility)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
49
|
+
T::Configuration.without_ruby_warnings do
|
50
|
+
T::Private::DeclState.current.without_on_method_added do
|
51
|
+
mod.module_eval(<<~METHOD, __FILE__, __LINE__ + 1)
|
52
|
+
#{original_visibility}
|
53
|
+
|
54
|
+
def #{method_sig.method_name}(...)
|
55
|
+
# We allow abstract methods to be implemented by things further down the ancestor chain.
|
56
|
+
# So, if a super method exists, call it.
|
57
|
+
if defined?(super)
|
58
|
+
super
|
59
|
+
else
|
60
|
+
raise NotImplementedError.new(
|
61
|
+
"The method `#{method_sig.method_name}` on #{mod} is declared as `abstract`. It does not have an implementation."
|
62
|
+
)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
METHOD
|
62
66
|
end
|
63
|
-
|
67
|
+
end
|
64
68
|
end
|
65
69
|
|
66
70
|
def self.create_validator_method(mod, original_method, method_sig, original_visibility)
|
data/lib/types/private/sealed.rb
CHANGED
@@ -22,14 +22,14 @@ module T::Private::Sealed
|
|
22
22
|
module NoIncludeExtend
|
23
23
|
def included(child)
|
24
24
|
super
|
25
|
-
caller_loc = T::Private::CallerUtils.find_caller {|loc|
|
25
|
+
caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'included'}
|
26
26
|
T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'included')
|
27
27
|
@sorbet_sealed_module_all_subclasses << child
|
28
28
|
end
|
29
29
|
|
30
30
|
def extended(child)
|
31
31
|
super
|
32
|
-
caller_loc = T::Private::CallerUtils.find_caller {|loc|
|
32
|
+
caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'extended'}
|
33
33
|
T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'extended')
|
34
34
|
@sorbet_sealed_module_all_subclasses << child
|
35
35
|
end
|
@@ -397,8 +397,9 @@ class T::Props::Decorator
|
|
397
397
|
T::Configuration.without_ruby_warnings do
|
398
398
|
if !rules[:immutable]
|
399
399
|
if method(:prop_set).owner != T::Props::Decorator
|
400
|
+
d = @class.decorator
|
400
401
|
@class.send(:define_method, "#{name}=") do |val|
|
401
|
-
|
402
|
+
d.prop_set(self, name, val, rules)
|
402
403
|
end
|
403
404
|
else
|
404
405
|
# Fast path (~4x faster as of Ruby 2.6)
|
@@ -407,8 +408,9 @@ class T::Props::Decorator
|
|
407
408
|
end
|
408
409
|
|
409
410
|
if method(:prop_get).owner != T::Props::Decorator || rules.key?(:ifunset)
|
411
|
+
d = @class.decorator
|
410
412
|
@class.send(:define_method, name) do
|
411
|
-
|
413
|
+
d.prop_get(self, name, rules)
|
412
414
|
end
|
413
415
|
else
|
414
416
|
# Fast path (~30x faster as of Ruby 2.6)
|
data/lib/types/types/class_of.rb
CHANGED
@@ -21,14 +21,14 @@ module T::Types
|
|
21
21
|
|
22
22
|
# overrides Base
|
23
23
|
def valid?(obj)
|
24
|
-
obj.is_a?(
|
24
|
+
obj.is_a?(@type.singleton_class)
|
25
25
|
end
|
26
26
|
|
27
27
|
# overrides Base
|
28
28
|
def subtype_of_single?(other)
|
29
29
|
case other
|
30
30
|
when ClassOf
|
31
|
-
@type
|
31
|
+
@type.is_a?(other.type.singleton_class)
|
32
32
|
when Simple
|
33
33
|
@type.is_a?(other.raw_type)
|
34
34
|
when TypedClass
|
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.
|
4
|
+
version: 0.5.12067
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|