< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #7271 has been updated by shugo (Shugo Maeda).
ko1 (Koichi Sasada) wrote:
> C_User#y is refined. Is that intentional?
Yes, it's intentional. Refinements are activated when C_User is reopend.
I'm not sure whether is'a good idea or not, but if C_User.module_eval is affected by refinements, it seems natural reopened definitions of C_User are also affected.
----------------------------------------
Bug #7271: Refinement doesn't seem lexical
https://bugs.ruby-lang.org/issues/7271#change-32359
Author: ko1 (Koichi Sasada)
Status: Assigned
Priority: Normal
Assignee: shugo (Shugo Maeda)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-01 trunk 37404) [i386-mswin32_100]
C_User#y is refined. Is that intentional?
class C
def foo
p :C_foo
end
end
module RefineC
refine C do
def foo
p :RefineC_foo
super
end
end
end
class C_User
using RefineC
def x
C.new.foo
end
end
class C_User
def y
C.new.foo
end
end
C_User.new.x
C_User.new.y
#=>
:RefineC_foo
:C_foo
:RefineC_foo
:C_foo
--
http://bugs.ruby-lang.org/