Project

General

Profile

Actions

Bug #13800

closed

Possible regression of Object#method in Ruby 2.3+ for aliases

Added by jmanian (Jeff Manian) about 7 years ago. Updated about 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.2.3, 2.2.7, 2.3.0, 2.3.3, 2.3.4, 2.4.1
[ruby-core:82333]

Description

The behavior of Object#method changed in 2.3 when using it to compare aliases. The change is best illustrated below:

module Foo
  def foo
  end
  alias_method :foo_foo, :foo
end

class Bar
  include Foo
  alias_method :bar, :foo
end

bar = Bar.new
bar.method(:foo) == bar.method(:bar)
# true in Ruby 2.2
# false in Ruby 2.3 and 2.4

bar.method(:foo) == bar.method(:foo_foo)
# true in Ruby 2.2, 2.3, 2.4

Was this an intentional change in 2.3 or a regression?
I tested this with 2.2.3, 2.2.7, 2.3.0, 2.3.3, 2.3.4, and 2.4.1.

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

  • Status changed from Open to Rejected
Actions

Also available in: Atom PDF

Like0
Like0