Issue #21844 has been updated by jnchito (Junichi Ito). I couldn't find the spec, but I found keywords can be index like Array: ```ruby Data.define(:a, :b).new(0 => 1, 1 => 2) #=> #<data a=1, b=2> Data.define(:a, :b).new(-2 => 1, -1 => 2) #=> #<data a=1, b=2> ``` So the code below seems to be OK: ```ruby Data.define(:a, :b).new(1 => 1, a: 2) #=> #<data a=2, b=1> ``` But the following code should raise ArgumentError(missing keyword: :a), right? ```ruby Data.define(:a, :b).new(1 => 1, b: 2) #=> #<data a=nil, b=2> ``` ---------------------------------------- Bug #21844: Inconsistent ArgumentError message for Data::define.new https://bugs.ruby-lang.org/issues/21844#change-116187 * Author: jnchito (Junichi Ito) * Status: Open * ruby -v: ruby 4.0.1 (2026-01-13 revision e04267a14b) +PRISM [arm64-darwin25] * Backport: 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- The code below shows `Data::define.new` treats symbol and string keys equivalently: ``` ruby C = Data.define(:a, :b) C.new(a: 1, b: 1) #=> #<data C a=1, b=1> C.new('a' => 1, 'b' => 1) #=> #<data C a=1, b=1> ``` But it acts differently when detecting missing keywords: ```ruby C.new(a: 1) #=> 'Data#initialize': missing keyword: :b (ArgumentError) C.new('a' => 1) #=> 'Data#initialize': missing keywords: :a, :b (ArgumentError) ``` I feel it should work like this: ```ruby C.new('a' => 1) #=> 'Data#initialize': missing keyword: :b (ArgumentError) ``` I created a PR to fix it: https://github.com/ruby/ruby/pull/15910 -- https://bugs.ruby-lang.org/