summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-17 14:44:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-17 14:44:14 +0000
commit11829a5368447bf4829fc040498457763d52a9b3 (patch)
treed2e65db5b3e3c26393647ef5cd82633f40b6457e /class.c
parentb1544b7d5dc2f88c0be9499bd62896632f295d12 (diff)
* 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
Diffstat (limited to 'class.c')
-rw-r--r--class.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/class.c b/class.c
index b35e1f8..32ee98b 100644
--- a/class.c
+++ b/class.c
@@ -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);