Actions
Bug #19280
closedWrong error message about arity of Data::define.new
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2022-12-28T16:43:05Z master cada537040) [x86_64-linux]
Description
$ ~/work/r/bin/ruby -e 'Data.define(:a, :b).new(1, 2, 3)'
-e:1:in `new': wrong number of arguments (given 3, expected 0..2) (ArgumentError)
Data.define(:a, :b).new(1, 2, 3)
^^^^^^^
from -e:1:in `<main>'
On this message, "expected 2" is appropriate because fewer arguments are not allowed.
$ ~/work/r/bin/ruby -e 'Data.define(:a, :b).new(1)'
-e:1:in `initialize': missing keyword: :b (ArgumentError)
Data.define(:a, :b).new(1)
^
from -e:1:in `new'
from -e:1:in `<main>'
Actions
Like0
Like0Like0