summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-07 04:33:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-07 04:33:00 +0000
commit9bb8f28f3d5bbf8ca54a3b59ffb435464df433bd (patch)
tree576904a1b1d7950213c7905f801b53053d89da86 /class.c
parent8e1a0856ed370726898400c139abbfd9556e618c (diff)
class.c: err if superclass is 0
* class.c (rb_define_class, rb_define_class_id_under): raise ArgumentError if super is 0, deprecated behavior which has been warned long time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/class.c b/class.c
index b4eaabc..0261838 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));