Project

General

Profile

Actions

Bug #17824

closed

Gem::Deprecate#deprecate doesn't work with method with keyword arguments

Added by hieuk09 (Hieu Nguyen) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:103585]

Description

Method with keyword argument cannot be used with Gem::Deprecate. Here is an example:

class Thing
  extend Gem::Deprecate

  def foo(name:)
    puts name
  end

  def bar(name:)
    foo(name: name)
  end
  deprecate :bar, :foo, 2021, 9
end

Thing.new.bar(name: 'ABC') # raise ArgumentError (wrong number of arguments (given 1, expected 0; required keyword: name))

Updated by mame (Yusuke Endoh) almost 3 years ago

Thank you for your report. I've created a pull request to rubygems upstream. https://github.com/rubygems/rubygems/pull/4558

Actions #2

Updated by jeremyevans0 (Jeremy Evans) almost 3 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0