summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 16:48:21 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-11 16:48:21 +0000
commitb5e9c6cb903aa550713f5f5764964560f98e180f (patch)
treef73d838c6da7736da75bbd66a26ae12cb61cc631 /eval.c
parent9f69bef99bdaf542e3cc93215bcf5e1dbba1b91b (diff)
* eval.c (rb_using_refinement): make the method table of an iclass
for a refinement that of the refinement, not that of the origin of the refinement, which is set by rb_include_class_new(). This change is needed to make module prepend into a refinement work properly. * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index c32b974363..f6a7b5dfb1 100644
--- a/eval.c
+++ b/eval.c
@@ -1078,6 +1078,7 @@ rb_using_refinement(NODE *cref, VALUE klass, VALUE module)
FL_SET(module, RMODULE_IS_OVERLAID);
c = iclass = rb_include_class_new(module, superclass);
RCLASS_REFINED_CLASS(c) = klass;
+ RCLASS_M_TBL(c) = RCLASS_M_TBL(module);
module = RCLASS_SUPER(module);
while (module && module != klass) {
FL_SET(module, RMODULE_IS_OVERLAID);