Project

General

Profile

Actions

Bug #7269

closed

Refinement doesn't work if using locate after method

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:48773]

Description

Refinement doesn't work if using locate after method.
(I eliminate discussion because my laptop doesn't have enough power...)

class C
def foo
p :C_foo
end
end

module M1
refine C do
def foo
p :M1_foo
super
end
end
end

module M2
refine C do
def foo
p :M2_foo
super
end
end
end

class D
using M1

def x
C.new.foo
end

using M2
end

p :x
D.new.x

#=>
:x
:M1_foo
:C_foo

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0