sorbet-runtime 0.5.10802 → 0.5.10803

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
  SHA256:
3
- metadata.gz: 5004ef6b79f17839bdaeba7d64017c3877849a37a767cfb4c3a941b295336607
4
- data.tar.gz: a47811314ee8449d9ca2c13b1e25391e8b20600a8b633b57e22a036ad5d4a1f0
3
+ metadata.gz: e8f2a6f0327904a3a54ce9116a19778a60b5bdc911e7f93e6c2a85e56c94d3e5
4
+ data.tar.gz: df1ba0d0e0c3c44f57c6d3569b5cc9cbe2d82048575324a018dafe703952038d
5
5
  SHA512:
6
- metadata.gz: 3a9726cb3e08bf0c98ad3a54f8326309a9981b4e2de2fcde58bd4a81181f9d38c52120f8e4f8abdc90df6b7b4997139a8bd8703ec8351df90b060cdb1959e9a1
7
- data.tar.gz: 00e90a39ee3784b72a8a36d98c53a7172b909da815403bf1a9b08e2301d8995c8f86b5045a5867610583cbd7a59b5b39d24e8139289a31d889880e32e9dc35d6
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.10802
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-04 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