sorbet-runtime 0.4.4488 → 0.4.4489
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19183723ae45c2ada6482baa860e1464c519c73b
|
4
|
+
data.tar.gz: 5f01aa46a1a96a96202e73cb95b100480338352c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1727553304f6d7461ff65c1ccfca756883ea0f6105789ad853e1de355ff9018ec5b9892ea9e2b58cac37d8096a55ab253c76d7d95fd47017e72c56756ae346f5
|
7
|
+
data.tar.gz: 84722c1a6432db6a955b0816d5cf1a5c0c12e47cc6c464c92a9004f7de071817cc0b2633d047d7be6feb4de448b2ea5547b4156d8a9e580fbb0eb12ddc192d7c
|
@@ -171,20 +171,10 @@ module T::Private::Methods
|
|
171
171
|
|
172
172
|
# Only public because it needs to get called below inside the replace_method blocks below.
|
173
173
|
def self._on_method_added(hook_mod, method_name, is_singleton_method: false)
|
174
|
-
if T::Private::DeclState.current.skip_next_on_method_added
|
175
|
-
T::Private::DeclState.current.skip_next_on_method_added = false
|
176
|
-
return
|
177
|
-
end
|
178
|
-
|
179
174
|
current_declaration = T::Private::DeclState.current.active_declaration
|
180
175
|
mod = is_singleton_method ? hook_mod.singleton_class : hook_mod
|
181
176
|
original_method = mod.instance_method(method_name)
|
182
177
|
|
183
|
-
if T::Private::Final.final_module?(mod) && (current_declaration.nil? || !current_declaration.final)
|
184
|
-
raise "`#{mod.name}` was declared as final but its method `#{method_name}` was not declared as final"
|
185
|
-
end
|
186
|
-
_check_final_ancestors(mod, mod.ancestors, [method_name])
|
187
|
-
|
188
178
|
return if current_declaration.nil?
|
189
179
|
T::Private::DeclState.current.reset!
|
190
180
|
|
@@ -198,7 +188,6 @@ module T::Private::Methods
|
|
198
188
|
# (or unwrap back to the original method).
|
199
189
|
new_method = nil
|
200
190
|
# this prevents us from running the final checks twice for every method def.
|
201
|
-
T::Private::DeclState.current.skip_next_on_method_added = true
|
202
191
|
T::Private::ClassUtils.replace_method(mod, method_name) do |*args, &blk|
|
203
192
|
if !T::Private::Methods.has_sig_block_for_method(new_method)
|
204
193
|
# This should only happen if the user used alias_method to grab a handle
|
@@ -433,7 +422,6 @@ module T::Private::Methods
|
|
433
422
|
attached = nil
|
434
423
|
# this prevents the final checks from triggering about singleton_method_added not being a final method even if the
|
435
424
|
# module is final.
|
436
|
-
T::Private::DeclState.current.skip_next_on_method_added = true
|
437
425
|
original_singleton_method = T::Private::ClassUtils.replace_method(singleton_klass, :singleton_method_added) do |name|
|
438
426
|
attached = self
|
439
427
|
T::Private::Methods._on_method_added(self, name, is_singleton_method: true)
|
@@ -163,7 +163,6 @@ module T::Private::Methods::CallValidation
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def self.create_validator_method(mod, original_method, method_sig, original_visibility)
|
166
|
-
T::Private::DeclState.current.skip_next_on_method_added = true
|
167
166
|
has_fixed_arity = method_sig.kwarg_types.empty? && !method_sig.has_rest && !method_sig.has_keyrest &&
|
168
167
|
original_method.parameters.all? {|(kind, _name)| kind == :req}
|
169
168
|
all_args_are_simple = method_sig.arg_types.all? {|_name, type| type.is_a?(T::Types::Simple)}
|