[ruby-core:77119] [Ruby trunk Bug#11186] Can't refine aliases in subclasses
From:
shugo@...
Date:
2016-09-01 07:04:49 UTC
List:
ruby-core #77119
Issue #11186 has been updated by Shugo Maeda.
Assignee set to Shugo Maeda
----------------------------------------
Bug #11186: Can't refine aliases in subclasses
https://bugs.ruby-lang.org/issues/11186#change-60341
* Author: Shugo Maeda
* Status: Open
* Priority: Normal
* Assignee: Shugo Maeda
* ruby -v: ruby 2.3.0dev (2015-05-27 trunk 50647) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
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.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>