diff --git a/ChangeLog b/ChangeLog index 2dc4cbd558..45d6a94d73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Mar 7 13:32:58 2016 Nobuyoshi Nakada + + * class.c (rb_define_class, rb_define_class_id_under): raise + ArgumentError if super is 0, deprecated behavior which has been + warned long time. + Mon Mar 7 13:28:30 2016 Nobuyoshi Nakada * internal.h: move function declarations for class internals from diff --git a/class.c b/class.c index b4eaabc250..0261838e5d 100644 --- a/class.c +++ b/class.c @@ -660,7 +660,7 @@ rb_define_class(const char *name, VALUE super) return klass; } if (!super) { - rb_warn("no super class for `%s', Object assumed", name); + rb_raise(rb_eArgError, "no super class for `%s'", name); } klass = rb_define_class_id(id, super); rb_vm_add_root_module(id, klass); @@ -732,8 +732,8 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super) return klass; } if (!super) { - rb_warn("no super class for `%"PRIsVALUE"::%"PRIsVALUE"', Object assumed", - rb_class_path(outer), rb_id2str(id)); + rb_raise(rb_eArgError, "no super class for `%"PRIsVALUE"::%"PRIsVALUE"'", + rb_class_path(outer), rb_id2str(id)); } klass = rb_define_class_id(id, super); rb_set_class_path_string(klass, outer, rb_id2str(id));