Project

General

Profile

Actions

Bug #7271

closed

Refinement doesn't seem lexical

Added by ko1 (Koichi Sasada) about 12 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-11-01 trunk 37404) [i386-mswin32_100]
Backport:
[ruby-core:48820]

Description

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


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #4085: Refinements and nested methodsClosedshugo (Shugo Maeda)11/24/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0