From b5e9c6cb903aa550713f5f5764964560f98e180f Mon Sep 17 00:00:00 2001 From: shugo Date: Tue, 11 Dec 2012 16:48:21 +0000 Subject: * 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 --- eval.c | 1 + 1 file changed, 1 insertion(+) (limited to 'eval.c') 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); -- cgit v1.2.3