sorbet-runtime 0.5.10801 → 0.5.10803

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba54a82310e9ffdf36ed09764075c214e2d764ba9bc7b3458c632ec1b6f214ba
4
- data.tar.gz: aa7aae3663dd6f3996cf061402abdb0ccca41ba5cf68b0e17ce7bf1f067ec866
3
+ metadata.gz: e8f2a6f0327904a3a54ce9116a19778a60b5bdc911e7f93e6c2a85e56c94d3e5
4
+ data.tar.gz: df1ba0d0e0c3c44f57c6d3569b5cc9cbe2d82048575324a018dafe703952038d
5
5
  SHA512:
6
- metadata.gz: 482e8190e0085bfae922f9845041c557a95effa46a819c61e003731afa65e351f51fe78ea438ded4eb2d9de3beb77116b51538e8b01b4fa48805ecc7b4a4edc3
7
- data.tar.gz: b2c3783a81f5913ca21eeb9c520697d8e4878e35dffd2a47f0550e1e5ba09cc0e3a1ffacd61ee57675dc3eea15eae12a49412e6e459ef31e742555edb17f77c9
6
+ metadata.gz: 986468a2c1b233457b54967925076ff3f991f698a4b1ff676709f59f5b27fa9990111e74ddfd3b92e3978b816a4d9b3193c0e6508e969aed38d07c8fe85ed735
7
+ data.tar.gz: c4158d6ce6012a05c023694222640ab338a324340186ed611a06bd2e5bd1366545080747ea934024a8b7b3a2dcf654ce51b5fd8506ee6edc0a746191febeb9fa
@@ -179,15 +179,7 @@ class T::Private::Methods::Signature
179
179
  kwargs = EMPTY_HASH
180
180
  end
181
181
 
182
- arg_types = @arg_types
183
-
184
- if @has_rest
185
- rest_count = args_length - @arg_types.length
186
- rest_count = 0 if rest_count.negative?
187
-
188
- arg_types += [[@rest_name, @rest_type]] * rest_count
189
-
190
- elsif (args_length < @req_arg_count) || (args_length > @arg_types.length)
182
+ if !@has_rest && ((args_length < @req_arg_count) || (args_length > @arg_types.length))
191
183
  expected_str = @req_arg_count.to_s
192
184
  if @arg_types.length != @req_arg_count
193
185
  expected_str += "..#{@arg_types.length}"
@@ -197,10 +189,23 @@ class T::Private::Methods::Signature
197
189
 
198
190
  begin
199
191
  it = 0
200
- while it < args_length
201
- yield arg_types[it][0], args[it], arg_types[it][1]
192
+
193
+ # Process given pre-rest args. When there are no rest args,
194
+ # this is just the given number of args.
195
+ while it < args_length && it < @arg_types.length
196
+ yield @arg_types[it][0], args[it], @arg_types[it][1]
202
197
  it += 1
203
198
  end
199
+
200
+ if @has_rest
201
+ rest_count = args_length - @arg_types.length
202
+ rest_count = 0 if rest_count.negative?
203
+
204
+ rest_count.times do
205
+ yield @rest_name, args[it], @rest_type
206
+ it += 1
207
+ end
208
+ end
204
209
  end
205
210
 
206
211
  kwargs.each do |name, val|
@@ -208,6 +213,7 @@ class T::Private::Methods::Signature
208
213
  if !type && @has_keyrest
209
214
  type = @keyrest_type
210
215
  end
216
+
211
217
  yield name, val, type if type
212
218
  end
213
219
  end
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.10801
4
+ version: 0.5.10803
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-03 00:00:00.000000000 Z
11
+ date: 2023-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest