sorbet 0.5.5903 → 0.5.5915
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/serialize.rb +13 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e036b6c68e754bfafd54d9032e2566d01bcfc27
|
4
|
+
data.tar.gz: 292c1b64000a5f861808a54dd7bc0a8bca7f2c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b2d8d5551bb10368083c220a894c94ded8166511db7287ebf974bd4204ec755e566f58b36210b990af6eb6dd9288e134f7e17d18fb0f1c340f5b471cc1a3cf4
|
7
|
+
data.tar.gz: 55a0ae20211e5e6732ac1d060aa43438cf5b46a588e8acdd815e8eb83ee5f3676fe485d28dfc486f1f1b9668b2269309ac4176638b5f6def5660415dd42c7f49
|
data/lib/serialize.rb
CHANGED
@@ -337,6 +337,19 @@ class Sorbet::Private::Serialize
|
|
337
337
|
uniq += 1
|
338
338
|
end
|
339
339
|
end
|
340
|
+
|
341
|
+
# Sanitize parameter names that are not valid.
|
342
|
+
# Ruby 2.7+ argument forwarding works by expanding `foo(...)`
|
343
|
+
# to `foo(**, ****, &&)`, in other words, to a rest parameter named
|
344
|
+
# `*`, a keyword rest parameter named `**` and a block argument named
|
345
|
+
# `&`. Those are all illegal parameter names which we should NOT
|
346
|
+
# generate. (Coincidentally, that is why Ruby 2.7+ uses those names,
|
347
|
+
# so that user code cannot mess with the forwarded arguments)
|
348
|
+
if ["*", "**", "&"].include?(name.to_s)
|
349
|
+
name = '_' + (uniq == 0 ? '' : uniq.to_s)
|
350
|
+
uniq += 1
|
351
|
+
end
|
352
|
+
|
340
353
|
[kind, name]
|
341
354
|
end
|
342
355
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorbet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5915
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-static
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.5.
|
19
|
+
version: 0.5.5915
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.5.
|
26
|
+
version: 0.5.5915
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|