Commit c6f5f637 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

supeclass type check prohibits class definition without superclass specified

parent e26bf08e
......@@ -213,8 +213,10 @@ mrb_vm_define_class(mrb_state *mrb, mrb_value outer, mrb_value super, mrb_sym id
if (!c) {
struct RClass *s = 0;
mrb_check_type(mrb, super, MRB_TT_CLASS);
if (!mrb_nil_p(super)) s = mrb_class_ptr(super);
if (!mrb_nil_p(super)) {
mrb_check_type(mrb, super, MRB_TT_CLASS);
s = mrb_class_ptr(super);
}
c = mrb_class_new(mrb, s);
setup_class(mrb, outer, c, id);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment