Permalink
Browse files

Copy over INSTANCE_TT when duping class

  • Loading branch information...
bouk committed Nov 21, 2016
1 parent a630c4f commit 73bb30c2f4dba7c8da091ec5c5308d6dacf5f52f
Showing with 9 additions and 0 deletions.
  1. +1 −0 src/kernel.c
  2. +8 −0 test/t/kernel.rb
View
@@ -285,6 +285,7 @@ copy_class(mrb_state *mrb, mrb_value dst, mrb_value src)
}
dc->mt = kh_copy(mt, mrb, sc->mt);
dc->super = sc->super;
MRB_SET_INSTANCE_TT(dc, MRB_INSTANCE_TT(sc));
}
static void
View
@@ -221,6 +221,14 @@ def a.test
assert_false c.respond_to?(:test)
end
assert('Kernel#dup class') do
assert_nothing_raised do
Array.dup.new(200)
Range.dup.new(2, 3)
String.dup.new("a"*50)
end
end
# Kernel#eval is provided by mruby-eval mrbgem '15.3.1.3.12'
assert('Kernel#extend', '15.3.1.3.13') do

0 comments on commit 73bb30c

Please sign in to comment.