sorbet-runtime 0.5.10611 → 0.5.10621

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: b429a321c8f8e870b1a804367749e54c42f426b6413bcf4a8fb21ad3fad05b49
4
- data.tar.gz: 258144350854c932cd5cadafa1bd1afc25c80bf8d9d0d0f47398ca440fb1f41b
3
+ metadata.gz: a6eb4950eaf0dcb0f10347e115ca43120227f648f90bf337cd4d20edd63f36f1
4
+ data.tar.gz: b8d4027e929cf655b27d18c1434afad2933a3b08f4a6f1fdfca9f3b421d0c99c
5
5
  SHA512:
6
- metadata.gz: 2a25d1217437877573b8a236ef72ef6117da2ccb40e328e77ed97d7edea656ba87ab053519c726ded4438132c2ca4f53b6ce9e41ac14fbc93417223886a99fcc
7
- data.tar.gz: cea142cd4f7377a8076f24d5a736be49339a1f359a6fa0d67c457abe5bce2e28f93ebb6e0b72e06a9488d763c9eb1400eb6c93344b0a4835a2a5d3d6fbd68017
6
+ metadata.gz: c2cb612010cb3c836ac8f02e1a8cb6d7e75df6c955e1da16e8d34c56fa05d924cb12f12cffe52d571e289395e173c9bcf9ba96e704bc590bb79a0f67866ed7bc
7
+ data.tar.gz: 60d233ec5d2b1efd1c6774d79b670f48ff01c2e15af4c580d594aaf95ff07cbe16b0432d2f211f033353a27de9c18d74b34b36a503fd67322fe9320682982a06
@@ -32,15 +32,29 @@ module T::Private::Methods
32
32
  )
33
33
  end
34
34
 
35
- def params(**params)
35
+ def params(*unused_positional_params, **params)
36
36
  check_live!
37
37
  if !decl.params.equal?(ARG_NOT_PROVIDED)
38
38
  raise BuilderError.new("You can't call .params twice")
39
39
  end
40
40
 
41
+ if unused_positional_params.any?
42
+ some_or_only = params.any? ? "some" : "only"
43
+ raise BuilderError.new(<<~MSG)
44
+ 'params' was called with #{some_or_only} positional arguments, but it needs to be called with keyword arguments.
45
+ The keyword arguments' keys must match the name and order of the method's parameters.
46
+ MSG
47
+ end
48
+
41
49
  if params.empty?
42
- raise BuilderError.new("params expects keyword arguments")
50
+ raise BuilderError.new(<<~MSG)
51
+ 'params' was called without any arguments, but it needs to be called with keyword arguments.
52
+ The keyword arguments' keys must match the name and order of the method's parameters.
53
+
54
+ Omit 'params' entirely for methods with no parameters.
55
+ MSG
43
56
  end
57
+
44
58
  decl.params = params
45
59
 
46
60
  self
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.10611
4
+ version: 0.5.10621
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-08 00:00:00.000000000 Z
11
+ date: 2023-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest