sorbet-runtime 0.6.13373 → 0.6.13385
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/signature_validation.rb +11 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0aacbc65290ea00436b377b9a9ae5a6119eb7565103690f3ca48dc5367af409b
|
|
4
|
+
data.tar.gz: a557477677d13ba37a1ec5e2ca923d844fadaf5414761d6fffcf49a5afebd1eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73a78a106b7d7620d5731266b11e44c68376bfb7d93f3f20aa650fb78a915b484070864d03ef0d8ff858d15e36fbb5057764bc51121219033d09f4854874c9d4
|
|
7
|
+
data.tar.gz: 6df95518c869b5c12a0f7ac873be2b38359f249a03dbc68020d20199f104d55055df9dc9c1bb51e83165dd3bf241f504362b46fdddd6b100632c2bea0e4a9a96
|
|
@@ -256,16 +256,23 @@ module T::Private::Methods::SignatureValidation
|
|
|
256
256
|
#
|
|
257
257
|
# An index loop avoids allocating a pair array per positional arg.
|
|
258
258
|
# Iterating to super's length is deliberate: extra override positionals
|
|
259
|
-
# go unchecked, and when the override
|
|
260
|
-
#
|
|
259
|
+
# go unchecked, and when the override folds the remaining base positionals
|
|
260
|
+
# into a rest param, each is checked against the rest param's type
|
|
261
|
+
# (validate_override_shape guarantees such a rest param exists here).
|
|
261
262
|
super_arg_types = super_signature.arg_types
|
|
262
263
|
arg_types = signature.arg_types
|
|
264
|
+
rest_type = signature.rest_type
|
|
263
265
|
index = 0
|
|
264
266
|
while index < super_arg_types.length
|
|
265
267
|
super_type = super_arg_types.fetch(index)[1]
|
|
266
268
|
pair = arg_types[index]
|
|
267
|
-
|
|
268
|
-
|
|
269
|
+
if pair
|
|
270
|
+
name = pair[0]
|
|
271
|
+
type = pair[1]
|
|
272
|
+
else
|
|
273
|
+
name = signature.rest_name
|
|
274
|
+
type = rest_type
|
|
275
|
+
end
|
|
269
276
|
if !super_type.subtype_of?(type)
|
|
270
277
|
raise "Incompatible type for arg ##{index + 1} (`#{name}`) in signature for #{mode_noun} of method " \
|
|
271
278
|
"`#{signature.method_name}`:\n" \
|