diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-05-07 00:20:49 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-05-07 00:20:49 +0000 |
commit | bc66ac228c9e1ab8f0f8335a386c75bb6c1d92d2 (patch) | |
tree | b8f1d71bf7fecff539c5942016ea252aa4a9357d /eval.c | |
parent | 40225b8cb53b3bcd79b2b30ad93f87197b8da31c (diff) |
* eval.c (superclass): undesirable "unexpected return" when the superclass is not a Class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1445,7 +1445,6 @@ superclass(self, node) } POP_TAG(); if (state) { - superclass_error: switch (nd_type(node)) { case NODE_COLON2: rb_raise(rb_eTypeError, "undefined superclass `%s'", @@ -1458,7 +1457,10 @@ superclass(self, node) } JUMP_TAG(state); } - if (TYPE(val) != T_CLASS) goto superclass_error; + if (TYPE(val) != T_CLASS) { + rb_raise(rb_eTypeError, "superclass must be a Class (%s given)", + rb_class2name(CLASS_OF(val))); + } if (FL_TEST(val, FL_SINGLETON)) { rb_raise(rb_eTypeError, "can't make subclass of virtual class"); } |