Actions
Bug #16465
closedFalse keyword warning against Struct#initialize
Description
The following code is warned:
Sample2 = Struct.new(:s1, :s2, :s3) do
def initialize(a1:, a2:)
super(a1, a2, a1 + a2)
end
end
p Sample2.new(a1:1, a2:2)
#=> test.rb:6: 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
I think the code is innocent and the warning is false positive. I'll create a pull request.
Actions
Like0
Like0Like0Like0Like0