Actions
Bug #11247
closedShould position of `using` affect the behavior?
Description
The following script makes two refinements refine class C.
class C
def foo
p C
end
end
module R1
refine C do
def foo
p R1
super
end
end
end
module R2
refine C do
def bar
C.new.foo
end
using R1
def baz
C.new.foo
end
end
end
using R2
C.new.bar
C.new.baz
R2 refines C with methods bar
and baz
. The difference is the place of using
. bar
is located before using
and baz
is after.
Recent fix changed behavior of this script.
- trunk in May: C and R1, C
- current trunk: R1, C and R1, C
This change is caused by sharing CREF between methods in same CREF scope. It reduce memory consumption (before this fix, we need one CREF per one method).
Is it acceptable change or unacceptable?
Actions
Like0
Like0Like0Like0