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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>