1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* class.c (rb_define_class): warn unless superclass is specified

explicitly.

* class.c (rb_define_class_under): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-02-17 14:44:14 +00:00
parent b1544b7d5d
commit 11829a5368
2 changed files with 14 additions and 0 deletions

View file

@ -9,6 +9,13 @@ Sun Feb 17 21:39:24 2002 Tetsuya Watanabe <tetsuya.watanabe@nifty.com>
* ext/digest/sha2/sha2init.c (Init_sha2): ditto.
Sun Feb 17 18:10:09 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* class.c (rb_define_class): warn unless superclass is specified
explicitly.
* class.c (rb_define_class_under): ditto.
Fri Feb 15 14:40:38 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): replace rb_cvar_declare() by rb_cvar_set().

View file

@ -193,6 +193,9 @@ rb_define_class(name, super)
}
return klass;
}
if (!super) {
rb_warn("no super class for `%s', Object assumed", name);
}
klass = rb_define_class_id(id, super);
rb_class_inherited(super, klass);
st_add_direct(rb_class_tbl, id, klass);
@ -220,6 +223,10 @@ rb_define_class_under(outer, name, super)
}
return klass;
}
if (!super) {
rb_warn("no super class for `%s::%s', Object assumed",
rb_class2name(outer), name);
}
klass = rb_define_class_id(id, super);
rb_set_class_path(klass, outer, name);
rb_class_inherited(super, klass);