Project

General

Profile

Actions

Bug #17824

closed

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

Added by hieuk09 (Hieu Nguyen) about 2 months ago. Updated 7 days ago.

Status:
Closed
Priority:
Normal
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) about 2 months 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) 7 days ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF