Project

General

Profile

Actions

Bug #19829

closed

Enumerator.product called with keyword arguments raises exception with not precise message

Added by andrykonchin (Andrew Konchin) over 1 year ago. Updated about 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:114340]

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

Also available in: Atom PDF

Like0
Like1Like0