Actions
Bug #19829
closedEnumerator.product called with keyword arguments raises exception with not precise message
Description
The Enumerator.product
method, added in Ruby 3.2, when it's called with keyword arguments (but it expects only a list of enums) raises unknown keyword: ... (ArgumentError)
exception:
Enumerator.product([], a: 1)
# (irb):1:in `product': unknown keyword: :a (ArgumentError)
But AFAIK unknown keyword
is used when a method expects keyword arguments and some not supported keyword arguments were passed. So I would expect raising exception with no keywords accepted (ArgumentError)
message instead that states clearly that no keywords should be passed.
Actions
Like0
Like1Like0