From: igel@... Date: 2020-05-13T18:11:11+00:00 Subject: [ruby-core:98327] [Ruby master Bug#16856] Structs accepting keyword arguments issue a warning with Ruby 2.7 Issue #16856 has been reported by iGEL (Johannes Barre). ---------------------------------------- Bug #16856: Structs accepting keyword arguments issue a warning with Ruby 2.7 https://bugs.ruby-lang.org/issues/16856 * Author: iGEL (Johannes Barre) * Status: Open * Priority: Normal * ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- This code is issuing a warning with Ruby 2.7, but should not: ``` ruby class NotFine < Struct.new(:x) def initialize(x, arg:) end end class Fine def initialize(x, arg:) end end NotFine.new(1, arg: 1) # This is causing the warning Fine.new(1, arg: 1) # This is not ``` ``` $ ruby test.rb test.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call test.rb:2: warning: The called method `initialize' is defined here ``` -- https://bugs.ruby-lang.org/ Unsubscribe: