From: "kyanagi (Kouhei Yanagita) via ruby-core" Date: 2022-12-29T01:21:29+00:00 Subject: [ruby-core:111491] [Ruby master Bug#19280] Wrong error message about arity of Data::define.new Issue #19280 has been reported by kyanagi (Kouhei Yanagita). ---------------------------------------- Bug #19280: Wrong error message about arity of Data::define.new https://bugs.ruby-lang.org/issues/19280 * Author: kyanagi (Kouhei Yanagita) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2022-12-28T16:43:05Z master cada537040) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ``` $ ~/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 `
' ``` 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 `
' ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/