summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-28 03:07:37 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-28 03:07:37 (GMT)
commita13ab237c78f5bce21b7fc95690b0b173b427c1d (patch)
treeadb67246d27bcf05476cc972282bd8e7849c11e1 /class.c
parent6cdc55f4a3441e5b9b0839f3c3e0ae885a4bee90 (diff)
class.c: TypeError when superclass mismatch
* class.c (rb_define_class_id_under): raise TypeError exception same as ruby level class definition when superclass mismatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/class.c b/class.c
index f963f0c..991172a 100644
--- a/class.c
+++ b/class.c
@@ -703,7 +703,8 @@ rb_define_class_id_under(VALUE outer, ID id, VALUE super)
rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a class", rb_id2str(id));
}
if (rb_class_real(RCLASS_SUPER(klass)) != super) {
- rb_name_error(id, "%"PRIsVALUE" is already defined", rb_id2str(id));
+ rb_raise(rb_eTypeError, "superclass mismatch for class %"PRIsVALUE"",
+ rb_id2str(id));
}
return klass;
}