sorbet-runtime 0.5.10616 → 0.5.10621

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: 81e5abee1c08f93b5b9601d7c67ef60c7eb337ad6a8e7a07b64e4f8b434c0bc4
4
- data.tar.gz: e876af1abe9ff7ff4bd97d5c5f6f1e52c524e9eb0bb2ce270ecbae1e7c4e343e
3
+ metadata.gz: a6eb4950eaf0dcb0f10347e115ca43120227f648f90bf337cd4d20edd63f36f1
4
+ data.tar.gz: b8d4027e929cf655b27d18c1434afad2933a3b08f4a6f1fdfca9f3b421d0c99c
5
5
  SHA512:
6
- metadata.gz: 0734f963b40c5c66358e813040a08f64b089a1ebfcf7ed2d0aab58f318a4ea5d011781258f9e38b935c8fc656960f80308cbd50e98abea41270ab7a969880d96
7
- data.tar.gz: 6caccb38f1a5a7dab904f9a1c1529493c0589d0b03e40be047baa358cb74511591f29050f5c670ca65ecb95673f5a05e6c8968c92c544436ecb0af61f94942ce
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.10616
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-10 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