From 35a47376696db6a84cb2c5c707a370120165bc00 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 21 Dec 2003 08:29:06 +0000 Subject: * class.c (rb_check_inheritable): new function. [ruby-dev:22316] * intern.h: add prototype. * eval.c (superclass): use rb_check_inheritable(). * object.c (rb_class_initialize): check argument validity. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 10d52d651..545d678be 100644 --- a/eval.c +++ b/eval.c @@ -1699,13 +1699,7 @@ superclass(self, node) } JUMP_TAG(state); } - if (TYPE(val) != T_CLASS) { - rb_raise(rb_eTypeError, "superclass must be a Class (%s given)", - rb_obj_classname(val)); - } - if (FL_TEST(val, FL_SINGLETON)) { - rb_raise(rb_eTypeError, "can't make subclass of virtual class"); - } + rb_check_inheritable(val); return val; } -- cgit