Actions
Bug #11186
closedCan't refine aliases in subclasses
Description
In the following program, D.new.bar returns :original, but should return :refined.
class C
def foo
:original
end
end
class D < C
alias bar foo
end
module M
refine D do
def bar
:refined
end
end
end
using M
p D.new.bar
This bug seemed to be introduced in r45367.
Updated by shugo (Shugo Maeda) over 7 years ago
- Assignee set to shugo (Shugo Maeda)
Updated by shugo (Shugo Maeda) over 7 years ago
- Status changed from Open to Closed
Applied in changeset r56568.
- test/ruby/test_refinement.rb (test_refine_alias_in_subclass):
add a test to check that alias in subclasses can be refined.
[ruby-core:69374] [Bug #11186]
Updated by shugo (Shugo Maeda) over 7 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONTNEED
The bug was fixed in Ruby 2.3, and need not to be backported to prior versions, I think.
Actions
Like0
Like0Like0Like0